From mboxrd@z Thu Jan 1 00:00:00 1970 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.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 1C0AAC4332F for ; Thu, 3 Nov 2022 19:00:42 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4N3Ckw43dNz3dtc for ; Fri, 4 Nov 2022 06:00:40 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=MwuaEKRj; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.intel.com (client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=andriy.shevchenko@linux.intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=MwuaEKRj; dkim-atps=neutral Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4N3Cjv4qvFz2xfS for ; Fri, 4 Nov 2022 05:59:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667501987; x=1699037987; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=iDzJkwIYDgDj9s9QyYyQqMun6Fj8NrFnD6UKX0fcnAs=; b=MwuaEKRjZaSc+IJEudiD+wyUTTzxtTx9XAT2gE4OOwpis7ECQFtH3uxU bhc1GsTHDXORSVb5RJtWwLH+hrk3Lb1KQO0MFt/wK/C4U2p6djE8oemS+ dyJYX/VgYULln7+YpkfHOeuiyvEpcgfVnUy15819wi4Xv6vNd6TNUFsmf SYhO81aj0bRI8MTZvJT85kzPcdOi4OFhMIq9xBXwzL9wLAio/sdTbzZJH Gck3AAovH/seuZLKVLsDtPGAWJPiD5z2tZxFjStFpxd+KS4WyKqxmEnB4 Wlh36JtgCcnulrGltJm2FlFPZnFxgWKY/6WPZYlJwj8RqunQ+APbEbNvo w==; X-IronPort-AV: E=McAfee;i="6500,9779,10520"; a="290166543" X-IronPort-AV: E=Sophos;i="5.96,135,1665471600"; d="scan'208";a="290166543" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.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?= 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-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pci@vger.kernel.org, Dominik Brodowski , linux-mips@vger.kernel.org, Bjorn Helgaas , sparclinux@vger.kernel.org, Stefano Stabellini , "Rafael J. Wysocki" , Russell King , Bjorn Helgaas , Miguel Ojeda , xen-devel@lists.xenproject.org, Matt Turner , Arnd Bergmann , Richard Henderson , Nicholas Piggin , Ivan Kokshaysky , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Mika Westerberg , linux-arm-kernel@lists.infradead.org, Juergen Gross , Thomas Bogendoerfer , linux-kernel@vger.kernel.org, Oleksandr Tyshchenko , linux-alpha@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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