Message ID | 20230320131633.61680-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:604a:0:0:0:0:0 with SMTP id j10csp1216780wrt; Mon, 20 Mar 2023 06:30:06 -0700 (PDT) X-Google-Smtp-Source: AK7set92Z+PL5fWeKTjV+g7R8mUbLDqPYI9gYpn0VgTCDbg9BzUVR+X1ruxuuEKJyVuyzrWfIIA9 X-Received: by 2002:a17:902:e292:b0:19c:c87b:4740 with SMTP id o18-20020a170902e29200b0019cc87b4740mr14218280plc.34.1679319006378; Mon, 20 Mar 2023 06:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679319006; cv=none; d=google.com; s=arc-20160816; b=CYhwsWXU8GDdp26Bqt7Xo2sdjNv6vQZvBlSR6M2aMUgaduT0NyNBmDlTRmOLNkTEQi Pdk/VSh4JrHBVz5swQ45M70eIzao3JKqesLVAE05ap4LAYMILmGzjwrsVsOtrc5Sk28t yg2kGTlSmWHMncA3xB1c6wD7O8g0Z0N/6nnPILXbzjLa2eNaCjM2FUK3dPdB+gxwZao3 grCvQm8mz74vpaNJ7m8UZUojBi4kEHN04GWBWRodULfo1YEDjWsUtZVyeGQPT5Bc608G NUggN5XZ5I+VR5fPuS2R4rrdpKcGaPipLvPffSSsvipFFeTfq0NoXqwMw1ovsCGIgxOW W5mw== 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=uGy73J8PN36RGUWXkk9NgU+l5Ua5i6MonmZmSoLXPaA=; b=f2Xd3JThxRmr+ziC278hZDCshbBrG+WVwZCviPvg0EO9C2uJW4jsrlPa1EY1LQ9ABC kK7DdSIR2lrV7PHhy0qZbUjbPEqp2qKbQLTj3ysmCBw+Q+L6MEqC7ZVnQwgLbLD0poe3 amOhsvm31qQKlQt3wuA7oiQNtG6TuP2iOuYhFwhg6JewDA+mwQftg+BrCRtfLCHcVObG ZXUYp7PV+T+7M3PoVSiPQyYuAvd0iePyYggDVqLXhx5MFLfYreCtttqZCnFyx+L8T0kA A8c157s0yD0gfr4Wc9+ZpP/abzqha76KlzTBPUEDVLMItxlG6UL1vt6brLL7lesF/Dfp YcVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TpoBUQy2; 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 c28-20020a634e1c000000b005032da21acasi10198429pgb.204.2023.03.20.06.29.51; Mon, 20 Mar 2023 06:30:06 -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=TpoBUQy2; 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 S231738AbjCTNRe (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Mon, 20 Mar 2023 09:17:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231740AbjCTNRQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Mar 2023 09:17:16 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B62E23876; Mon, 20 Mar 2023 06:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679318230; x=1710854230; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w+YdvYGhoz+V3BkfBUt2y8DW6u+jmfOhlK0R9Fvr/bI=; b=TpoBUQy2MQkqkvAXVIqGRIHW/QhPQgkx9okD+ydx9FaQUrr0hpEWL+PK 6dr0yA6JG/mxRzj1deJCv3Rmwtfz/s28bnY/Grbop0SxlXSZHVL3h+2tu KKrWy6ZSPHYg339QC5ObQb0jfBAGZbzwMj15+4/ivL2QjSyZdgLXOmks2 6oPTsYlsKOM1HCstPgEE3groCs1yiuMgBGEGuc38AL79enYDoLNCGWxTF S7tmMgTcphzSZ6jofzmZ7Bo08ZS6qW29N7UBiooibhiwSEnLli2Ro9afT hH+XmJsG7n9ZntkJiqgum4jxqNBNsZpCbJYzhBRkZ1d96xNXXIHaLAWAr Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10655"; a="424932327" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="424932327" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Mar 2023 06:16:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="674382659" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="674382659" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 20 Mar 2023 06:15:58 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1D5485A7; Mon, 20 Mar 2023 15:16:44 +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 v6 3/4] EISA: Convert to use pci_bus_for_each_resource_p() Date: Mon, 20 Mar 2023 15:16:32 +0200 Message-Id: <20230320131633.61680-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230320131633.61680-1-andriy.shevchenko@linux.intel.com> References: <20230320131633.61680-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,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?1760893606264037953?= X-GMAIL-MSGID: =?utf-8?q?1760893606264037953?= |
Series |
Add pci_dev_for_each_resource() helper and update users
|
|
Commit Message
Andy Shevchenko
March 20, 2023, 1:16 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;