Message ID | 20230310171416.23356-4-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:5915:0:0:0:0:0 with SMTP id v21csp993877wrd; Fri, 10 Mar 2023 09:16:02 -0800 (PST) X-Google-Smtp-Source: AK7set/coVWvcAEfoVcDnnG9PKZk5nxeISnb9kR5llPtN1wHPqL09HsLnEQx1WSFPNtJZ6l0wNbi X-Received: by 2002:a62:648c:0:b0:5a8:58b5:bfa9 with SMTP id y134-20020a62648c000000b005a858b5bfa9mr17952281pfb.12.1678468562551; Fri, 10 Mar 2023 09:16:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678468562; cv=none; d=google.com; s=arc-20160816; b=Qwr6DN9HlQ+rEykaKwJF1OOmAVTVmjnwOKWMnMUTp2yZDc5zEKQkfVHSlS83BlElqz 2fxm7fQYtTEyv7s3eB732GRAi1jTWmeofpz4DRPmSOSMGdMkr4eNpaR1Z2YpySpvQDsu HkrV8FEv12FqfOqZ/3n9Lw2ayg1nCXtXCr2YLJK01multOGaormadG8O130Vk8o85Ui2 EH3agRXAmowHJWuc9J5RiY6k4Wjxi5GXEiv5vr3eu4XeCzfMtLeJOQ9MrC4FgNLasLqH ZY1mJKP7BIovWwKqDOau6b+MiGCZhCfA6uoMCtuEyp0jKMSDB8OI0fcpQ2AYa4Du8vZM 2F+A== 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=pblzQhbPNBksTVsIt1SpuCH4eEI1Gfg/+m2mzBx2M7Y=; b=ismjY0Y1H0uWQACYKBLLerPST/3F8ZB/YYckzPuBXTG8fD94eQ3djh5yvYsXpwCvh8 V4AVdsk8T/e6yKNhAgvXPNHXrt7aBb8j2zu+5wlNNCtOBLma5UlAkR8E/dP8Ar9JFFCz M6SaXAnpd0q/FaAL4CjWDiw+SQwrzmNayRRoq2R3NZ3FhOBpf9+NZUmrDLJMqLUqdE2N a7vipTnQpsHdRpkKdSt6oycwAAE7ONFseWcJHpKeH9Mj/ECR5xiH5GZ35ESlbdbANc70 nAFf9ma6ZzGFKroNlPZMVAT0dbpdsPSnCQ4JkL4ePaSJv2zH5z+qzvPANqQebl22ZJzE uUAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PIUkkohn; 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 v4-20020a622f04000000b005e3ff6ee57fsi99918pfv.320.2023.03.10.09.15.49; Fri, 10 Mar 2023 09:16:02 -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=@intel.com header.s=Intel header.b=PIUkkohn; 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 S231211AbjCJROj (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Fri, 10 Mar 2023 12:14:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbjCJROU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Mar 2023 12:14:20 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 349D7A56B3; Fri, 10 Mar 2023 09:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678468450; x=1710004450; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XiU+o/uX7/9asxJWP74CXm0XTbLgvXwYQIiNjIPtko8=; b=PIUkkohnnedlJL78nxialTXtivr7pWxgRQRlqPi5V5mgNg0gQsEZtMrg aQ1RLqFQI5YJ6kw/vofetjVNPZg1IfBGoeiZOwwrrGCNzBXkWjOB4yYlZ vjWUbH4hdByI72MbFUNabjmkG0/NBbaGOGqmShavQsd7uRiO1w8MBh1o8 oiVrs1uwvEF54SjxU1ZJKP/ls/SVxtBQGJB/u0a8SXzgwkSDUgw8noo83 k7Mpr4el4+5erwCrV29HmuRNZaIlT5G3CNHQrRFBQ0XjEfBaRjfdWxPUP WCUDc/8lqPXDhCBZlPcCZBfxheldfp/8F1lk/kkKMxFISytwo4ozAYX+K A==; X-IronPort-AV: E=McAfee;i="6500,9779,10645"; a="325132277" X-IronPort-AV: E=Sophos;i="5.98,250,1673942400"; d="scan'208";a="325132277" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2023 09:13:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10645"; a="655250056" X-IronPort-AV: E=Sophos;i="5.98,250,1673942400"; d="scan'208";a="655250056" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 10 Mar 2023 09:13:37 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 7AE48354; Fri, 10 Mar 2023 19:14:21 +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>, Bjorn Helgaas <helgaas@kernel.org>, "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>, Niklas Schnelle <schnelle@linux.ibm.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 v4 3/4] EISA: Convert to use pci_bus_for_each_resource_p() Date: Fri, 10 Mar 2023 19:14:15 +0200 Message-Id: <20230310171416.23356-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230310171416.23356-1-andriy.shevchenko@linux.intel.com> References: <20230310171416.23356-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=-4.3 required=5.0 tests=BAYES_00,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, URIBL_BLOCKED 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: <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?1760001851439930408?= X-GMAIL-MSGID: =?utf-8?q?1760001851439930408?= |
Series |
PCI: Add pci_dev_for_each_resource() helper and update users
|
|
Commit Message
Andy Shevchenko
March 10, 2023, 5:14 p.m. UTC
The pci_bus_for_each_resource_p() hides 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 index 930c2332c3c4..907b86384396 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_p(pdev->bus, res) if (res && (res->flags & IORESOURCE_IO)) { bus_res = res; break;