Message ID | 20230323173610.60442-5-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp3047386wrt; Thu, 23 Mar 2023 10:41:35 -0700 (PDT) Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QSaSrPyw X-Google-Smtp-Source: AKy350bYyjCe8/b+WcSg4S+eIwlDN23aSqwFxPYNcVM59BRS9D75+PDFhIrwXg8Bc2eIA0HBmels X-Received: by 2002:a17:90b:3116:b0:23d:96ec:b910 with SMTP id gc22-20020a17090b311600b0023d96ecb910mr6597797pjb.20.1679593295363; Thu, 23 Mar 2023 10:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679593295; cv=none; d=google.com; s=arc-20160816; b=fwiFL9XIn2dO0vA7iEotk7Pvx2N/5xXxHldVp9Fw3Pq99RkoDMpfZicouCf949qd3R RKMMnp+wsnHlp00ATbiHyxijY8bmD47ynFmJY34qBKS6R5se34SgDgLe6Ptg3fHBpozI 0cEev25iEtadG459SYPUew0qgQ+sC8BhIgSwnvOP5bD3Y4m3fO6Xc5Mm0T/DnqBt+Y99 khgcmhrUYCSQNE3wPZjjG3sM5DdutvvLNCD/jBVZCg5OBl4WlO1wMJmoyPHbm97DDveU QPkCm85wdAGwmfZQikMDWeSGgMNTc6U3OAq3FFfzxL4mjY6B1ej01P0ZAOk2dE4XH7Oi nzOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LoOIQues63fw4A/atvg8dXh1JRuotjlKwpIGJNEnMWA=; b=skWU2s+vqVlOSNrW+2fWS8VRIdT5/92DiGigfkU1xLxcOqSHtnRNzpz4F9Sk6WRaAP /xqCyAFiYrZ6vKOlUNMHotMGe5+u54gMMsSA6Kp6KC3M9AoZy7b6nVa178jLlR1RW6ym CtaY2f3UAhMDH9c70Yic1vSB53H6lDafC2ikaKE9wXR20vKFw74wcEajpetpIegtZg2N /1lduV9nMR1oVJ83Rkec8cpUlKgRPR746RxAhnXpVR/mLVpr/SiKb0hKuUI0hD5CCWkH val/Xqb64HWudk01MMSsVoVH3cBYp14zbPaHh3TxJIHIgW9bwtzi4ywW4FXVCzSpg02m q16A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QSaSrPyw; 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=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 6-20020a17090a190600b0023670bc014dsi2325716pjg.110.2023.03.23.10.41.22; Thu, 23 Mar 2023 10:41:35 -0700 (PDT) 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=@intel.com header.s=Intel header.b=QSaSrPyw; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229948AbjCWRgb (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Thu, 23 Mar 2023 13:36:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231526AbjCWRgJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Mar 2023 13:36:09 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47F363866E; Thu, 23 Mar 2023 10:35:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679592946; x=1711128946; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+tkQnp5raP0E2HuwxHdpBNe2fRW/pW0M4CrsRaTr0mM=; b=QSaSrPywXF8RhfXFHvhFTGz2B+As7nEnJuhabBEyqtNNZL49H8/A4G7C DI6Lq3P3fSrBPFVQfou/v76vUTY/SDaSAuhkoiGFAbI32hCYYVnAx9UiM StrfuVV+I0J6gfImirDju5zB4Mu0A3hnHAKHxDY5JSzgbMThsqMM161uu R3//xoAzfkylBh+AMnu3BoZjT9s6GIJzY9HFAzju9Ao9V/190Siz6tti/ O2Ux4Ffc67ZIABzMP21L/sfpczjeWpjDWBkDwRDpHMQ/f+7ALoQuStKur tNqnPGwdnkIpqROkrgEvY+qnhyNvGHNYM7XWxBg7ehF2NKyURbcQEGzEW Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="327969646" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="327969646" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 10:35:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="675794214" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="675794214" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 23 Mar 2023 10:35:25 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id EA7F02AA; Thu, 23 Mar 2023 19:36:11 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= <mic@digikod.net>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Mika Westerberg <mika.westerberg@linux.intel.com>, =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= <kw@linux.com>, Michael Ellerman <mpe@ellerman.id.au>, Randy Dunlap <rdunlap@infradead.org>, Arnd Bergmann <arnd@arndb.de>, Niklas Schnelle <schnelle@linux.ibm.com>, Bjorn Helgaas <helgaas@kernel.org>, "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>, =?utf-8?q?Pali_Roh=C3=A1r?= <pali@kernel.org>, "Maciej W. Rozycki" <macro@orcam.me.uk>, Juergen Gross <jgross@suse.com>, Dominik Brodowski <linux@dominikbrodowski.net>, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org Cc: Miguel Ojeda <ojeda@kernel.org>, Richard Henderson <richard.henderson@linaro.org>, Ivan Kokshaysky <ink@jurassic.park.msu.ru>, Matt Turner <mattst88@gmail.com>, Russell King <linux@armlinux.org.uk>, Andrew Lunn <andrew@lunn.ch>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Gregory Clement <gregory.clement@bootlin.com>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Nicholas Piggin <npiggin@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Anatolij Gustschin <agust@denx.de>, Yoshinori Sato <ysato@users.sourceforge.jp>, Rich Felker <dalias@libc.org>, John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>, "David S. Miller" <davem@davemloft.net>, Bjorn Helgaas <bhelgaas@google.com>, Stefano Stabellini <sstabellini@kernel.org>, Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> Subject: [PATCH v7 4/6] EISA: Convert to use less arguments in pci_bus_for_each_resource() Date: Thu, 23 Mar 2023 19:36:08 +0200 Message-Id: <20230323173610.60442-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230323173610.60442-1-andriy.shevchenko@linux.intel.com> References: <20230323173610.60442-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761181219216465526?= X-GMAIL-MSGID: =?utf-8?q?1761181219216465526?= |
Series |
Add pci_dev_for_each_resource() helper and update users
|
|
Commit Message
Andy Shevchenko
March 23, 2023, 5:36 p.m. UTC
The pci_bus_for_each_resource() can hide the iterator loop since it may be not used otherwise. With this, we may drop that iterator variable definition. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Krzysztof Wilczyński <kw@linux.com> --- drivers/eisa/pci_eisa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 23/3/23 18:36, Andy Shevchenko wrote: > The pci_bus_for_each_resource() can hide the iterator loop since > it may be not used otherwise. With this, we may drop that iterator > variable definition. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Reviewed-by: Krzysztof Wilczyński <kw@linux.com> > --- > drivers/eisa/pci_eisa.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c Since this is *PCI* EISA, could be squashed into previous patch. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
On Fri, Mar 24, 2023 at 10:02:15AM +0100, Philippe Mathieu-Daudé wrote: > On 23/3/23 18:36, Andy Shevchenko wrote: > > The pci_bus_for_each_resource() can hide the iterator loop since > > it may be not used otherwise. With this, we may drop that iterator > > variable definition. > > > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > Reviewed-by: Krzysztof Wilczyński <kw@linux.com> > > --- > > drivers/eisa/pci_eisa.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c > > Since this is *PCI* EISA, could be squashed into previous patch. I believe it would be better to have them separated. But if maintainers want to squash, I can do that. > Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Thank you!
diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c index 930c2332c3c4..8173e60bb808 100644 --- a/drivers/eisa/pci_eisa.c +++ b/drivers/eisa/pci_eisa.c @@ -20,8 +20,8 @@ static struct eisa_root_device pci_eisa_root; static int __init pci_eisa_init(struct pci_dev *pdev) { - int rc, i; struct resource *res, *bus_res = NULL; + int rc; if ((rc = pci_enable_device (pdev))) { dev_err(&pdev->dev, "Could not enable device\n"); @@ -38,7 +38,7 @@ static int __init pci_eisa_init(struct pci_dev *pdev) * eisa_root_register() can only deal with a single io port resource, * so we use the first valid io port resource. */ - pci_bus_for_each_resource(pdev->bus, res, i) + pci_bus_for_each_resource(pdev->bus, res) if (res && (res->flags & IORESOURCE_IO)) { bus_res = res; break;