Message ID | 20221103164644.70554-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:6687:0:0:0:0:0 with SMTP id l7csp647109wru; Thu, 3 Nov 2022 09:52:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5RUslQLes66PZmNYh85GMO3S7Omgt2KkkRwdVg+3nS+Jr/u6uasG7cERVNBGFFZ4fMtZHh X-Received: by 2002:a17:907:3186:b0:777:3fe7:4659 with SMTP id xe6-20020a170907318600b007773fe74659mr29908782ejb.336.1667494333248; Thu, 03 Nov 2022 09:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667494333; cv=none; d=google.com; s=arc-20160816; b=YfX2or4e8Dg17LntKqil6ri6/n3KVO8606LOK7lBzTTwD24zptzs2yws3mJdSXLcQE +4e/h+NPCR53swnuKdY7lq3qpSDQnxqamq4fbX7JzJQnr8c3TUUT9mkEEQ4k+D7zoIQ1 6uAAcz/MRo7PDKhyI0Go+0I/BFXroh0+sQDry4N/sae+kcjangjzRUj9oKPdvqvFBZJQ D87ekidlOJZsroqYc5p9lounPzrwjWxsGWJ3l9jvs/ynOUqWGwsM0eXLtjfHak8MX0zh lX9Nvo5+7cS+a2KoSAWMZQU72WdB+QnFcO2zlXkQKT8dpnWmUOD/M7KJl9ydQCyMJTsJ GWLg== 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=116YKWMv0Jblpl2kyjcsnQYXUs42BfItz/V64WWeJUk=; b=wec0P+rVYsqrkYkBThVjlJnfQcB1Wp/bHFrqxHXUnKaXyKJpn5n8Ygt6EYamcuKrA8 AvVdnpAtsF9SqVOY2on742As7MsNGGMWpcIpG8tlV/nL1v92rScAJUEQMm324BHOp3uK MzKAzWBuloPsesFnbxvOvL+mMpOPGXILJAwTVbab4foZrtLtnyVDTGZV+QVIwoslPAjj 29YSl4hCa9yX6xI7uqbqh4xL3b9B2gy4ndxK86DTTQJA3RbvC+RsAP+q2hpJXeBnb5iI TkGv+G9DsUc0A3MBWxPvrTlvXPosuHj12hZ3YCExEp0R1mmd2TMW4vjZ1TcUNwbfsCHM RcaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dkXSM4wH; 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 hs29-20020a1709073e9d00b007ab1b8b719csi2462259ejc.0.2022.11.03.09.51.49; Thu, 03 Nov 2022 09:52:13 -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=dkXSM4wH; 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 S230361AbiKCQrq (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Thu, 3 Nov 2022 12:47:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232530AbiKCQrL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 3 Nov 2022 12:47:11 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB60119C1B; Thu, 3 Nov 2022 09:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667493996; x=1699029996; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EaNuN468AX7oVVNzygbZKjeVdiuKUVO8jdpIxMpvwBE=; b=dkXSM4wHOuYtUhyvyq75B8MweJmqi5yuqRLxPmabh/asMdBZbjpgjd74 rDihfdGNWTqbsKdh7uAlseHOg1bQWN1Zfz2H17z54thIuMJtzP4mYTXtL HR5bLP/DuYI+Uw9sZIR4BFATAslnskiGBXR1KlNTKQ476tVSVFFR68fO/ 31ALWtoTMVHIjfN9j7bOZ9J1KwTounrfbud+H4VbXHdtj6gJk3tt9FwPk ucJLTyaT68ARU2UOVO/XsgvWB3DKaf6Y2q9bSnEnYCPTCHAks7FAxX3MF OnVO7v+9K7t7R9DvrReoi2rKNS5qs4MeH168H6XvLB0NyB9F+A8+TqHxC g==; X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="297198933" X-IronPort-AV: E=Sophos;i="5.96,134,1665471600"; d="scan'208";a="297198933" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2022 09:46:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="809735378" X-IronPort-AV: E=Sophos;i="5.96,134,1665471600"; d="scan'208";a="809735378" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga005.jf.intel.com with ESMTP; 03 Nov 2022 09:46:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id B75E129D; Thu, 3 Nov 2022 18:46:52 +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>, Michael Ellerman <mpe@ellerman.id.au>, Arnd Bergmann <arnd@arndb.de>, Bjorn Helgaas <helgaas@kernel.org>, "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>, 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, sparclinux@vger.kernel.org, linux-pci@vger.kernel.org, xen-devel@lists.xenproject.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>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Nicholas Piggin <npiggin@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, "David S. Miller" <davem@davemloft.net>, Bjorn Helgaas <bhelgaas@google.com>, Stefano Stabellini <sstabellini@kernel.org>, Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com> Subject: [PATCH v2 3/4] EISA: Convert to use pci_bus_for_each_resource_p() Date: Thu, 3 Nov 2022 18:46:43 +0200 Message-Id: <20221103164644.70554-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221103164644.70554-1-andriy.shevchenko@linux.intel.com> References: <20221103164644.70554-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.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 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?1748494537793266883?= X-GMAIL-MSGID: =?utf-8?q?1748494537793266883?= |
Series |
PCI: Add pci_dev_for_each_resource() helper and refactor bus one
|
|
Commit Message
Andy Shevchenko
Nov. 3, 2022, 4:46 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>
---
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;