Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp820779rwl; Fri, 24 Mar 2023 02:23:48 -0700 (PDT) X-Google-Smtp-Source: AKy350Y9xKmo3N5rzfqGOkDh12hmQrclWMKwRx0/DHsWxs5NXaXJqvslUCfwgbKhjGAL6rItrhHT X-Received: by 2002:a17:906:c2cf:b0:939:4c86:d47b with SMTP id ch15-20020a170906c2cf00b009394c86d47bmr2189711ejb.19.1679649828142; Fri, 24 Mar 2023 02:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679649828; cv=none; d=google.com; s=arc-20160816; b=jLISGk81QJ2ECdz0HPEcfzTYcA4EScx7BcKwZ3OmSuPTGdxkWESLBWwA7esQyi7Euv hn4BLRvMX5hmeYrRugyojTboW8UP63vmLVzZv5P5DWbdu3Sly42jZRymQ95HDiopUZzJ CjuDMW4lHsivtY2HA03qw4ioDeCFsMUONBV6m/IAVcX9Sb7Maiq/FmKnz4hRGwXsm3Lw C2h836p/eiJBrhBSNEEJ8fRcf9Bdf+/iNIvQK8KuQ5CmEkxa/pnxzXVFpT0zZNGJZiuC lsZrcDgGEgZ8KMAwLN076D5yYpcmzWn+F0aY6/am2WZD5TPHtBj6CDdnaMSXlGnzJluh Eh1Q== 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=GHb1Ojw59rU0DOuqQZE7Eyc9Oq6u6mAIl6a1R0iNOdQ=; b=KMkO3mpYO0TypMWU4jhSMk/JzjZWcmaa7m9vHaxu3KU3aGt5oAQsIZ8PUO3IS+5I8j g4ei3mKeb8FEIKV42R/9w3gF+TSRTNMxcrYoG8ICLUXftuGH7pA1IJghLfeK7NVwYqJe aiWloxL7oP9LIHfiK+ySA3Wm2cBisbARGymNRQ9wyuDn1gwzPhapFnzdAJg0ksrDa9mv 4U/62sTCjT9/5uaMWZcfVSLLdiVUa64O4uiP3HmAnTxjlZl1FIgY4Tv46MemKfRZTh5O UFMdzp3VUH5uhGuD6Fi9+LmwDBUAoSGI5V0Ckoc6a2AzuPYK6MvxaN6AfWlfBeR1+Zl9 9Pgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PxRGiXTN; 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 lc22-20020a170906f91600b00924c79a4314si19610873ejb.668.2023.03.24.02.23.24; Fri, 24 Mar 2023 02:23:48 -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=PxRGiXTN; 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 S232030AbjCXJV5 (ORCPT + 99 others); Fri, 24 Mar 2023 05:21:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231949AbjCXJVz (ORCPT ); Fri, 24 Mar 2023 05:21:55 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38C75233DE; Fri, 24 Mar 2023 02:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679649689; x=1711185689; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=Zv6p5PxBUIwRGR/FQTKCtRGfcJDPVTzeoNo7mhbkHhY=; b=PxRGiXTN6YBrH7uOleNvHOd8rB72J+4Q2yPZ0B6bIgU1pGI5oLsKcUnR N8IOmGHHOzoifXTutOmGi93xQUOT2/R+WV60Xut0UN4taXyZosJPESPnx RIBj3kthGQNoGA2XQ0l/LEIYhzaXATqBcBP5Z37Bkqu+DhStx4R6x5Y+R vQYOuMU26Moz8COz9eXSflZGu2AARC54Cy0MFqjFZACGV+J1TnXsSoN/h iIF2aCYzgknrrPEyrK0/hlFrLCM4+9iMUeNskvxgqzhni2j7pRGRax60L 8CLYisxfLm85EmrzhZJVJvbRcmJnjb4WLuDDQUl0cRPM46Yx6vAmE4byS g==; X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="320129732" X-IronPort-AV: E=Sophos;i="5.98,287,1673942400"; d="scan'208";a="320129732" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2023 02:21:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10658"; a="771814725" X-IronPort-AV: E=Sophos;i="5.98,287,1673942400"; d="scan'208";a="771814725" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP; 24 Mar 2023 02:20:59 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pfdbS-007qWb-1l; Fri, 24 Mar 2023 11:20:54 +0200 Date: Fri, 24 Mar 2023 11:20:54 +0200 From: Andy Shevchenko To: Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= Cc: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Mika Westerberg , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Michael Ellerman , Randy Dunlap , Arnd Bergmann , Niklas Schnelle , Bjorn Helgaas , "Rafael J. Wysocki" , Pali =?iso-8859-1?Q?Roh=E1r?= , "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, 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: Re: [PATCH v7 6/6] PCI: Make use of pci_resource_n() Message-ID: References: <20230323173610.60442-1-andriy.shevchenko@linux.intel.com> <20230323173610.60442-7-andriy.shevchenko@linux.intel.com> <1722e75c-bc06-4a34-5e12-fa3622ed86a3@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1722e75c-bc06-4a34-5e12-fa3622ed86a3@linaro.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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,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 On Fri, Mar 24, 2023 at 10:08:39AM +0100, Philippe Mathieu-Daud? wrote: > On 23/3/23 18:36, Andy Shevchenko wrote: > > Replace open-coded implementations of pci_resource_n() in pci.h. ... > > #define pci_resource_n(dev, bar) (&(dev)->resource[(bar)]) > > -#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) > > -#define pci_resource_end(dev, bar) ((dev)->resource[(bar)].end) > > -#define pci_resource_flags(dev, bar) ((dev)->resource[(bar)].flags) > > -#define pci_resource_len(dev,bar) \ > > - ((pci_resource_end((dev), (bar)) == 0) ? 0 : \ > > - \ > > - (pci_resource_end((dev), (bar)) - \ > > - pci_resource_start((dev), (bar)) + 1)) > > +#define pci_resource_start(dev, bar) (pci_resource_n(dev, bar)->start) > > +#define pci_resource_end(dev, bar) (pci_resource_n(dev, bar)->end) > > +#define pci_resource_flags(dev, bar) (pci_resource_n(dev, bar)->flags) > > +#define pci_resource_len(dev,bar) \ > > + (pci_resource_end((dev), (bar)) ? \ > > + resource_size(pci_resource_n((dev), (bar))) : 0) > > Seems (to me) more logical to have this patch as "PCI: Introduce > pci_resource_n()" ordered before your patch #2 "PCI: Introduce > pci_dev_for_each_resource()". Either way works for me. Bjorn, what do you like? > Here as #6 or as #2: > Reviewed-by: Philippe Mathieu-Daud? Thank you! -- With Best Regards, Andy Shevchenko