Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5367195rwb; Tue, 17 Jan 2023 12:45:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXsWPbAnXDJMhA7jaV2sbLtEUjVD3E3SyUeSmBPIX3uIR9sPya/cdcXxnzjfzUsVDhSYjpYB X-Received: by 2002:a17:90b:344a:b0:219:20b4:9a0e with SMTP id lj10-20020a17090b344a00b0021920b49a0emr27311067pjb.24.1673988333268; Tue, 17 Jan 2023 12:45:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673988333; cv=none; d=google.com; s=arc-20160816; b=D37ym8Kv3rAB7Wd6TVUDidEfPw4uC2yyeQqJjnML93cdmg3483U7Ply8lNq8LQBKi+ IYKWc7MCQVxvRy6fJzOANyknPZexEoChowmW4m694zXwIp+/7OgotWbCfDYEy+ALhFww q9stK8SZIdF5BcJ16b0kLSd2zISay9EiFyVknhVjsheJfxfouZ8PgTGGMStk6iCmlr8u xktrjdSPC2SHgbF117TLLVr2leYMn9+sizYUAj2LB0q105/BF/8pwzWRYyAjWuFOl9tU qaxcqiv0goWV/RPSNHSm7VwLPB5U5mydf/B9BgwvDDQlGirJg/bhNf51jUGeeTuRvAM2 qJfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gBoO6+1+ry0mnOpbHSg8AYnXjylJZrfXvE1Da3T5q7k=; b=hYv4dV/t2WuLYI29qxjZzselLnzNCQYPh04JeOBNTa7R3AVh9iT6Vu041mcWjD+1oO WJpVDGkzRcmrtr7mCQoXSA46Hn8P3wWYI8yyhh67XLNwSfhx8xpB5g4asaMHM+r1jfPD 9rZGJtZCQj2QNGxTdikQd1eV+1wGO6cm0lzTzYxBlQvPmr+oCkvDx/P2Wx8lEQLAHEAR uzgXBBONgZUQZ/CR6yeFrelOFIWM7oQKuIgk9HojC2eAnMZpp7d291T8qK2WqKFB/fCp Q85jT/9G1BLPIbKtYEcHnD4djKTALaJeMhBWDjNH1gpwaIdnaFSIWxhoNMrsX9RCE73Y 7/OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="tBsL+P/P"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my6-20020a17090b4c8600b002297f945cf0si7052456pjb.57.2023.01.17.12.45.27; Tue, 17 Jan 2023 12:45:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="tBsL+P/P"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233801AbjAQSpn (ORCPT + 47 others); Tue, 17 Jan 2023 13:45:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235160AbjAQSjz (ORCPT ); Tue, 17 Jan 2023 13:39:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29AE31E287 for ; Tue, 17 Jan 2023 10:11:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BC508614FC for ; Tue, 17 Jan 2023 18:11:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 961E2C433F0; Tue, 17 Jan 2023 18:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673979116; bh=C34Ci/xYdbH/8oLA3YDDw/yrOZeRQzsgzaXlxYuh1Sk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tBsL+P/Pnhp3jwwebsmkMk0ME7nkJ/guAhYZ7OtOvxE7lQxJhjpNkuwamrPGpZRtV hx8P8u8ZaxjPlwzirpgCpwG4l5WGiVi27LTiL72a5xpbcoFi09lOGXU9IoPy2qjR+b aLAIuPhs1vszPNPYF40qirKWUHkZxMOne8a1nD3c= Date: Tue, 17 Jan 2023 19:11:53 +0100 From: Greg Kroah-Hartman To: Soha Jin Cc: "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: Re: [PATCH driver-core-next] platform: remove useless if-branch in __platform_get_irq_byname() Message-ID: References: <20221111094542.270540-1-soha@lohu.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221111094542.270540-1-soha@lohu.info> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 11, 2022 at 05:45:42PM +0800, Soha Jin wrote: > When CONFIG_OF_IRQ is not enabled, there will be a stub method that always > returns 0 when getting IRQ. Thus, the if-branch can be removed safely. > > Fixes: d4ad017d6345 ("platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq") > Signed-off-by: Soha Jin > --- > drivers/base/platform.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/base/platform.c b/drivers/base/platform.c > index 968f3d71eeab..6cd7fd478c5f 100644 > --- a/drivers/base/platform.c > +++ b/drivers/base/platform.c > @@ -441,11 +441,9 @@ static int __platform_get_irq_byname(struct platform_device *dev, > struct resource *r; > int ret; > > - if (!dev->dev.of_node || IS_ENABLED(CONFIG_OF_IRQ)) { > - ret = fwnode_irq_get_byname(dev_fwnode(&dev->dev), name); > - if (ret > 0 || ret == -EPROBE_DEFER) > - return ret; > - } > + ret = fwnode_irq_get_byname(dev_fwnode(&dev->dev), name); > + if (ret > 0 || ret == -EPROBE_DEFER) > + return ret; It's not really a "fix", so I'll be dropping that tag here. thanks, greg k-h