From patchwork Thu Mar 23 17:36:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13185970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A02C6C6FD1C for ; Thu, 23 Mar 2023 17:37:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZyFycdiFJzGIHqx4MiWyNIwWNb1DwQo+b7WRVb5xRGE=; b=hOQ6gnmZHmSRat KAZXIIPFVJf/4aD8Lj025GgWsqgXIUVcmKS7Qf0sAvjGwoM2lVg6zqtzun64QRuM8tPT32GdahTNZ 9scMK9Yug2sniqSv2ISe6ex4I9H7fBeu5Hn22BDz5SO3aXDgcbTtO2DYtuidJiiLgWpk54JOMKfbg sW0oVbb1L1oprEm3Rkc424o4fx0RwijzZTUX0JolTPq97rGfRYLIcl6/LwJZCGMhxP1ednZCmgDh9 pfwFF0XFr2KhPXy0NHHiRdh20tOGFXk+K3QGwSY9TouqNGwQm2PIQTk7pui9C7oIioFErZPW978ME Z5mxBq/yJLTmP78qP8OA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pfOrQ-002cKg-0T; Thu, 23 Mar 2023 17:36:24 +0000 Received: from mga01.intel.com ([192.55.52.88]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pfOqw-002c6z-0B for linux-arm-kernel@lists.infradead.org; Thu, 23 Mar 2023 17:35:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679592954; x=1711128954; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CylzEgRAmJXOphwnxg3IbL2UXwW6z4Wch9KnUOezzDg=; b=Fa88d2GWcVcgGwMKOUEgOswJie7LEyG74GsuOs7c/rzkr4YwpGflEWHP 1whvhL0bVIQeB3GBa6z4LT0SeJ1en8pAIFLwTWqskIROKGQS2MKf1T+4S MRCh0oAbyvb/5FUiGARg1BOc2U7cLjTL39to+nmliV4bfN681/T14adrA Qe9Ni+e1qW67RuFf06IiFShThoPfcJRbZPjYdq/d8DGx+kKh7F+2+81tV 7NktlrYR5qbNYoXDkxYFYWmDWJ8M7PMHN0C+QR5ytEqNe9sxDN/wQa6oA 2pnppfNBkXj16jd1tl6RpkTwSFYTBg/Sdx2twwqr0ahJYGeclc8yQewx+ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="367308179" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="367308179" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Mar 2023 10:35:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="682380753" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="682380753" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 23 Mar 2023 10:35:36 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0945631F; Thu, 23 Mar 2023 19:36:11 +0200 (EET) From: Andy Shevchenko To: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , Andy Shevchenko , Mika Westerberg , =?utf-8?q?Krzysztof_Wilc?= =?utf-8?q?zy=C5=84ski?= , Michael Ellerman , Randy Dunlap , Arnd Bergmann , Niklas Schnelle , Bjorn Helgaas , "Rafael J. Wysocki" , =?utf-8?q?Pali_Roh=C3=A1r?= , "Maciej W. Rozycki" , 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, 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 , Richard Henderson , Ivan Kokshaysky , Matt Turner , Russell King , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Thomas Bogendoerfer , Nicholas Piggin , Christophe Leroy , Anatolij Gustschin , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "David S. Miller" , Bjorn Helgaas , Stefano Stabellini , Oleksandr Tyshchenko Subject: [PATCH v7 5/6] pcmcia: Convert to use less arguments in pci_bus_for_each_resource() Date: Thu, 23 Mar 2023 19:36:09 +0200 Message-Id: <20230323173610.60442-6-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230323_103554_128986_D4068855 X-CRM114-Status: GOOD ( 17.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Krzysztof WilczyƄski Acked-by: Dominik Brodowski --- drivers/pcmcia/rsrc_nonstatic.c | 9 +++------ drivers/pcmcia/yenta_socket.c | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c index ad1141fddb4c..96264ebee46a 100644 --- a/drivers/pcmcia/rsrc_nonstatic.c +++ b/drivers/pcmcia/rsrc_nonstatic.c @@ -934,7 +934,7 @@ static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long static int nonstatic_autoadd_resources(struct pcmcia_socket *s) { struct resource *res; - int i, done = 0; + int done = 0; if (!s->cb_dev || !s->cb_dev->bus) return -ENODEV; @@ -960,12 +960,9 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s) */ if (s->cb_dev->bus->number == 0) return -EINVAL; - - for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) { - res = s->cb_dev->bus->resource[i]; -#else - pci_bus_for_each_resource(s->cb_dev->bus, res, i) { #endif + + pci_bus_for_each_resource(s->cb_dev->bus, res) { if (!res) continue; diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index 1365eaa20ff4..fd18ab571ce8 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c @@ -673,9 +673,8 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res, u32 min) { struct resource *root; - int i; - pci_bus_for_each_resource(socket->dev->bus, root, i) { + pci_bus_for_each_resource(socket->dev->bus, root) { if (!root) continue;