From patchwork Thu Mar 30 16:24:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13194541 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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 EC621C761A6 for ; Thu, 30 Mar 2023 16:29:06 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.516812.801576 (Exim 4.92) (envelope-from ) id 1phv8r-0006PJ-TI; Thu, 30 Mar 2023 16:28:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 516812.801576; Thu, 30 Mar 2023 16:28:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1phv8r-0006P3-PS; Thu, 30 Mar 2023 16:28:49 +0000 Received: by outflank-mailman (input) for mailman id 516812; Thu, 30 Mar 2023 16:28:48 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1phv8q-0004tu-LQ for xen-devel@lists.xenproject.org; Thu, 30 Mar 2023 16:28:48 +0000 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id f0b8694e-cf17-11ed-b464-930f4c7d94ae; Thu, 30 Mar 2023 18:28:46 +0200 (CEST) Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2023 09:28:39 -0700 Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 30 Mar 2023 09:28:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4A5522E9; Thu, 30 Mar 2023 19:24:53 +0300 (EEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f0b8694e-cf17-11ed-b464-930f4c7d94ae DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680193726; x=1711729726; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CylzEgRAmJXOphwnxg3IbL2UXwW6z4Wch9KnUOezzDg=; b=KWdy3V8PuSK/O9+XoiZNNnunwlnaY0F5BUg2OmimFGnUp1wZTl/5exrd n+Y4U9UnzKB6Z9GKmhDGSNR2o2dH3Q7NpSAAyCguS5g2e352hfvqPvTZY Oe3T/kdo859DwvyFStL/tlET33PdcZReDeYUjwW+THHn9NJt/EgzB5iFu m3n6ZV9BdGCKM1zXnx9IMgiG5fzIDnLiy3qHNH0XARN5GBQ6zmGnaRVQy 51sAhUOcMNf8gqAciCcgBZ0cZkJUHaoWMgaAAUN+YaZO5Qn66i+J4sk5y LFNYcI8Y6c7fa8VQu7ZjaTOxplNoa/sh2M5to+Y3BJGGMBC9szhGUuc98 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="321607014" X-IronPort-AV: E=Sophos;i="5.98,305,1673942400"; d="scan'208";a="321607014" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="687307670" X-IronPort-AV: E=Sophos;i="5.98,305,1673942400"; d="scan'208";a="687307670" From: Andy Shevchenko To: =?utf-8?q?Micka=C3=ABl_Sala=C3=BCn?= , Andy Shevchenko , =?utf-8?q?Krzysztof_Wi?= =?utf-8?q?lczy=C5=84ski?= , Mika Westerberg , Michael Ellerman , Randy Dunlap , Arnd Bergmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , 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 v8 7/7] pcmcia: Convert to use less arguments in pci_bus_for_each_resource() Date: Thu, 30 Mar 2023 19:24:34 +0300 Message-Id: <20230330162434.35055-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20230330162434.35055-1-andriy.shevchenko@linux.intel.com> References: <20230330162434.35055-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 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;