Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2089890rwi; Thu, 3 Nov 2022 12:31:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hK8H845H4VL7JKBodK/n/GfZGwsnea+wdz+qFFBPXmgh37o7u0CIldagNtCUqLp0Dc9qn X-Received: by 2002:a17:902:e811:b0:186:8a61:ea76 with SMTP id u17-20020a170902e81100b001868a61ea76mr31935055plg.10.1667503867451; Thu, 03 Nov 2022 12:31:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667503867; cv=none; d=google.com; s=arc-20160816; b=i0Mbhz9IsTV7pLOxSNbsFalOdIORdy4tOlLAd+Vrf2Zbzs5pLbXOz1CMi6WhZBhp+C 0srbxwkRNwvHN+iqA/oQ63a6oy4hT1sdqbEgsIIoTDOcLg30iLjwEDORZZJyWUt8ZQ8g Y1riLMMaHh0UoHc8MK1l+67dELg6lPmtb5Inb26BAHN/W8C/YKaOtT6awvLFvMza8iHW LwdeC1Je2SWXF1shTIDxAQFOVCYoRATs14SQEb2WQzh4jadOytNgS94Kj26xzq00WC4X yf1xwdLdSnihwEL4qlniyqfpA9POW7Wn0CzPzPNz7inRfMFrs+iGi2zsKsgUQjiLcbnw ieRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mNokhrDrPLhy0AEAOTjduihrkYNsMyIOR9KRUXydC38=; b=NX7kvFiL4d+t7NOFKoS681pA/gmoxt+q1kC5qdIHAcJEL1cnNlJRk9aV18oO/3gAr7 6a0mXzcL99sExvLg5FI2d5NJBIPW3Piy0NOmwIhaX/b+KpjnvE3EYnlfjAoluUI7RLz9 9cXJoRcgeVfD79/oQJKJQU5/9Es+XiyHM3pO5zaoyMLROFzGdyuTJTetHBWU+GxyJAIT om49asC4i8YvbfQYJ0IRhfW7NdNqe2sJoNqvyl06uHl3bfp66Kdg+CFzNJrMp0vDtslB TU60iXkkclSzkcYebW/QC4rMfYULJN44BaofCOHfBvk+rb1BBH+Os6nL2kwq8DVPWNOl yVgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=U1Umt9qk; 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 mu18-20020a17090b389200b00202b78e2adasi909034pjb.102.2022.11.03.12.30.54; Thu, 03 Nov 2022 12:31: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=U1Umt9qk; 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 S229507AbiKCS7s (ORCPT + 97 others); Thu, 3 Nov 2022 14:59:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbiKCS7p (ORCPT ); Thu, 3 Nov 2022 14:59:45 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B1B7FD3C; Thu, 3 Nov 2022 11:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667501985; x=1699037985; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=iDzJkwIYDgDj9s9QyYyQqMun6Fj8NrFnD6UKX0fcnAs=; b=U1Umt9qku3GYocruQL5t/15455Rny7EXR4FHjNANVPsZL25YbnUAmdw7 qIzTFjDWCpBgRXNs3Vbg1eHClJd1/n5Wa49RgzySMT3ePursA7PQg7cXD sLjdAwNydWb/Vt1ChnQmxLcAQf95L6jvAT4KX6UtC4kwn8aujIzJrWwQS bKdewFI+vEeeGUC9VHlUrHdjxCqn0dn86Rca8THquoXv8VgMtdbmbVFFA w1kxOgKcc3YhgFBkK3NoJ0GO4PBXfg2QNkTCPW9PFJjwIfH5yf9PfE5vf IVlV/x38M2FJ9Zjdqc1379zmLj14WK/LfvvHm6CIVsSp/Xex+l6bFwfEf Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="293099746" X-IronPort-AV: E=Sophos;i="5.96,135,1665471600"; d="scan'208";a="293099746" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2022 11:59:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="724055696" X-IronPort-AV: E=Sophos;i="5.96,135,1665471600"; d="scan'208";a="724055696" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP; 03 Nov 2022 11:59:37 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1oqfR8-006zVP-0o; Thu, 03 Nov 2022 20:59:34 +0200 Date: Thu, 3 Nov 2022 20:59:33 +0200 From: Andy Shevchenko To: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= Cc: Dominik Brodowski , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Mika Westerberg , Michael Ellerman , Arnd Bergmann , Bjorn Helgaas , "Rafael J. Wysocki" , Juergen Gross , 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, Miguel Ojeda , Richard Henderson , Ivan Kokshaysky , Matt Turner , Russell King , Thomas Bogendoerfer , Nicholas Piggin , Christophe Leroy , "David S. Miller" , Bjorn Helgaas , Stefano Stabellini , Oleksandr Tyshchenko Subject: Re: [PATCH v2 4/4] pcmcia: Convert to use pci_bus_for_each_resource_p() Message-ID: References: <20221103164644.70554-1-andriy.shevchenko@linux.intel.com> <20221103164644.70554-5-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,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: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 04, 2022 at 03:29:44AM +0900, Krzysztof WilczyƄski wrote: > > > > - > > > > - 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_p(s->cb_dev->bus, res) { > > > > if (!res) > > > > continue; > > > > > > Doesn't this remove the proper iterator for X86? Even if that is the right > > > thing to do, it needs an explict explanation. > > > > I dunno what was in 2010, but reading code now I have found no differences in > > the logic on how resources are being iterated in these two pieces of code. > > This code is over a decade old (13 years old to be precise) and there was > something odd between Bjorn's and Jesse's patches, as per: > > 89a74ecccd1f ("PCI: add pci_bus_for_each_resource(), remove direct bus->resource[] refs") > cf26e8dc4194 ("pcmcia: do not autoadd root PCI bus resources") Yeah, thanks for pointing out to the other patch from the same 2010 year. It seems the code was completely identical that time, now it uses more sophisticated way of getting bus resources, but it's kept the same for the resources under PCI_BRIDGE_RESOURCE_NUM threshold. > > But fine, I will add a line to a commit message about this change. > > I wouldn't, personally. The change you are proposing is self-explanatory > and somewhat in-line with what is there already - unless I am also reading > the current implementation wrong. But it wouldn't be harmful either. > That said, Dominik is the maintainer of PCMCIA driver, so his is the last > word, so to speak. :) > > > Considering this is done, can you issue your conditional tag so I will > > incorporate it in v3? > > No need, really. Again, unless Dominik thinks otherwise. I think that what is wanted to have to get his tag. Thanks for review, both of you, guys! -- With Best Regards, Andy Shevchenko