From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: [PATCH v3 3/4] EISA: Convert to use pci_bus_for_each_resource_p() Date: Mon, 14 Nov 2022 20:58:21 +0200 Message-ID: <20221114185822.65038-4-andriy.shevchenko@linux.intel.com> References: <20221114185822.65038-1-andriy.shevchenko@linux.intel.com> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668452288; x=1699988288; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EaNuN468AX7oVVNzygbZKjeVdiuKUVO8jdpIxMpvwBE=; b=GlUNU2HwIQvRlT1qXEhiDcwxNbPnZR4MonvxxZT7Xc0wBuUPib2XJH6/ a6TTFGUvE5vGmxXKbgiiDWuJiEvp7W94ecNolPwFN3tldFSP0iclExoAN QEYJIQf9cd/A4IJ7qraUHIl9qGKK//fuihWWwihU1Gd8jm5+kE9VUrVSh a0BhaG0YXmskoyz8YurHpbvi6+bpnkUoegi8a/pnmSylqZnbvE5C7z3n0 Wix7ZkDzWMxklQMENkLTdQ4KVoPz12w4VlRApJvQ3jYqpJqa5HzMtrej3 Z/2fohoofWjvo3e0UUL+c0XGK5jigXbAaniu4i+H6yTrkras/2bVXL+Lx A==; In-Reply-To: <20221114185822.65038-1-andriy.shevchenko@linux.intel.com> List-ID: Content-Type: text/plain; charset="us-ascii" To: =?UTF-8?q?Micka=C3=ABl=20Sala=C3=BCn?= , Mika Westerberg , Andy Shevchenko , Michael Ellerman , Arnd Bergmann , Bjorn Helgaas , "Rafael J. Wysocki" , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Juergen Gross , Dominik Brodowski , 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, sparclinux@vger.kernel.org, linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org Cc: Miguel Ojeda , Richard Henderson , Ivan Kokshaysky , Matt Turner , Russell King , Thomas Bogendoerfer , Nicholas Piggin , Christophe Leroy , "David S. Miller" , Bjorn Helgaas , Stefano Stabellini , Oleksandr Tyshchenko 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 --- 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; -- 2.35.1