Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7959295rwl; Thu, 23 Mar 2023 10:43:08 -0700 (PDT) X-Google-Smtp-Source: AK7set+RkFusr+KLoNVYw6uqIEBF0BqeWo582V+Ihl1CSe0CZcNZjxJ4ldwOptvgqvAKkoi5YIx8 X-Received: by 2002:a05:6a20:bab0:b0:d9:c3f5:2933 with SMTP id fb48-20020a056a20bab000b000d9c3f52933mr356622pzb.20.1679593387758; Thu, 23 Mar 2023 10:43:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679593387; cv=none; d=google.com; s=arc-20160816; b=bOaOe6mK9FHBSJ8LlKNu/Zs4i2Q4NTHcZrvZrSS4kqpQf9pniWjZKn9rAmm2uhs4py v959Iya1SKVQRrAVaHhMkHie97G1lDniWzJ2Oa73rc5PzTEBo6ExUo4P0d5Q7hSLDy4Q +l7eMz1w+OMHXvIak9y5U0U0QE+S7fnDc5LWI55ol2efff55okc1jnPihI5dEtUO07wN JdAoxqAXad+xTnn9C4AlLSUCkSUVhoY1fhfeBHOYUWvvPAMspV2oJhIRwGLC1ndm57Nc u3QADyH9h74RaKPhayeqK4Ym2UI3Giglk4zax86jdPXT6rFOLfxXmFVUzLpsu7W0vUKE BnkA== 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=QeL1AtwXSCu6BtHRaduBPNduuZbKi0vfmTR7h3cfRP8=; b=rIC/2ZQTkAbeuLwh7sNWqDQGXJ0PIUX9Bdp6vxEELZEPJrCJ1nFT+WTuc/KDsNTuCn ofQIR702Sxp9n3jEQYXSrNk6QFv6YiGfbHlUyZCMLHLIorsxun7OCNk+m16I/8RyLL0N TJNpVetcjgBeiRq4tu0gyiGaNoyq7pr7wE5gGmLBQnh1Ynyn7qUAd/2B32sz/Fu39hn4 /grcdTw29DZRBkdqED+aVnndRxOmil+zCaU6GuH6YokEheh6t0DH41mnPXjfkHbOMlGT qceimMnlJxzMERFFpQStNHP3/+Ut4BGHQCAaOohenF1bCtv6ZGH6gZV27lae39rbRuVk wQVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VT3gEbqw; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l1-20020a654481000000b004786f5e24f9si18903712pgq.94.2023.03.23.10.42.55; Thu, 23 Mar 2023 10:43:07 -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=VT3gEbqw; 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 S231879AbjCWRhY (ORCPT + 99 others); Thu, 23 Mar 2023 13:37:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231805AbjCWRgY (ORCPT ); Thu, 23 Mar 2023 13:36:24 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFEF026CEF; Thu, 23 Mar 2023 10:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679592973; x=1711128973; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CylzEgRAmJXOphwnxg3IbL2UXwW6z4Wch9KnUOezzDg=; b=VT3gEbqwsWjiXtFeMN64ABKD26kj7pU2+OBZVNhFkd49d8lqV+nG+vQ6 IF3XgamOH3V4M58d0tqb7CDq/kCAoz8Wda4lKkLrarxXG9TI9R5MurY+B PHVhpFL8zdoYpvEMiduaoT3TfemHyNUIMYhLtk05h/1WRFZ4ro1gbiIfn zuuHkg+itSXK2vsgF0YPNV1pfcbr6yiuX4EBmr387FbywJS5IdjW1DDsE GI7KJ15OazZ9cdvzuIOT9o2Sdxmd6bBtW8CFIMOQSdWt5gUhKC2YYZOmx fQNEbAhBp6Dujv+RXOJ22PI3ABmFASPf6Dv00VVqkjAoyHEWTKK49b4hL Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="367308167" X-IronPort-AV: E=Sophos;i="5.98,285,1673942400"; d="scan'208";a="367308167" 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=20Sala=C3=BCn?= , Andy Shevchenko , Mika Westerberg , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Michael Ellerman , Randy Dunlap , Arnd Bergmann , Niklas Schnelle , Bjorn Helgaas , "Rafael J. Wysocki" , =?UTF-8?q?Pali=20Roh=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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=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=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.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; -- 2.40.0.1.gaa8946217a0b