Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp814992rwl; Fri, 24 Mar 2023 02:17:13 -0700 (PDT) X-Google-Smtp-Source: AKy350YFpvsz2/uKWa8fyAQYISBTefZpZ3lQCiUNPGKuxbLnHgVDERGpNZfooydT45qcGPxfbyYE X-Received: by 2002:a05:6402:718:b0:502:1d1d:5c9c with SMTP id w24-20020a056402071800b005021d1d5c9cmr1895867edx.33.1679649432886; Fri, 24 Mar 2023 02:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679649432; cv=none; d=google.com; s=arc-20160816; b=0o/QNCr1GODZ2UzQgFeGGBUVW6cLUJXAZ07cEFxtvzDU0eJghSsWRfC0nm/8kojb7J j4rFwf7h3c4/zPlDor4428gPVGQQkOqkyKyXq5LlXLyNuCKrlOm3b5wbhsK8DElMQ/vo H1oEAkvE/M+95KJqdfNlFI1RZntXHEO3R8B5lP4FN6ZclLk/uXmID5UwRi3e1Jn/v46u DIG1wLyBexBOG6C/HE7A/mUT0R1haOjttkIY1KkHMWmnjR2tZVxPzJntGJoNoIeLVfRa bP5X3oI+9Jfv87svuuhnHkY/QsKevl0JOcaPmmwH0upF3eJ/4GQKlid38qB/5KhDAQOp vFaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Tl24kxujrDRhD/Pw1VxqIQuGTyFCOtjGuHoJAXogeUQ=; b=iBzp29rFtAWX7j06B5s/rLFVmd6WtFQaiSZI8/jB6E+/lwJ0dYqJWekeAPwtoqxI/I 2gQBICFOCH1sbua9TyeLGjy/LjTB2WMWpJQxHg262hpUcvCiAfVfxXL7kGlK8cQcClzi bZbqZ3RzC7/vHfmYZNBqYUkbP00GpQEQZwJK3DOmv5aCbJ1717IKRWJfk4r63Mok0kUI t0Y+CpiuoQAM4JrtxvEtSTXS1QsBNMYqUzA1uGTARWrF/08/5sTOUgVM4q/kk0CxwhYZ /O9vgUGPkzcHeafWZpXv6/RVnF8DchjC3x0ZcqLQmYJJ0pvL/824E0D0mzpnC/J/Uuy+ W4oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KF7vhgGU; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020aa7c3c6000000b00502032f26dbsi3941255edr.625.2023.03.24.02.16.48; Fri, 24 Mar 2023 02:17:12 -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=@linaro.org header.s=google header.b=KF7vhgGU; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232053AbjCXJJJ (ORCPT + 99 others); Fri, 24 Mar 2023 05:09:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232058AbjCXJI5 (ORCPT ); Fri, 24 Mar 2023 05:08:57 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEAA811673 for ; Fri, 24 Mar 2023 02:08:45 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id s13so670235wmr.4 for ; Fri, 24 Mar 2023 02:08:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679648924; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Tl24kxujrDRhD/Pw1VxqIQuGTyFCOtjGuHoJAXogeUQ=; b=KF7vhgGUy9iSCVz/2JMV95cnXXiwuET9tU7Rc7Ha4nCWlEtjrRR52AkRL3JFzV31N8 FvBvjTemrQpnvLLevT/7WRHrnq6vQTjJaal/zyxaU9lnhkPgeE4ZxxrwnrSeYP5XXpBc 4V7jndgKaulVRlh2NX+8aC2vQ132DHHauBUvo9d076iWPZ097+573LyCG57UyqnF/weQ Wl0cANOGoKc/C+uNjEJ93bVBXPTZ7IkGYmTVHGwGkHxXXK4MlPEb6KAWoXYRQNmd8+4H wQFnUqtZsqyWz/Sra/sxWYXnULQ6q5z/LE5eyV19WnrETSaXYW26jzEB3xzi7XfnA3JF 5cvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679648924; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Tl24kxujrDRhD/Pw1VxqIQuGTyFCOtjGuHoJAXogeUQ=; b=tv8Fi8asZd99iK138q+RmUOBjXuqea7e+H9xxpXwtSiuyis2J5O1LTxq1bnJtK3TS4 DJBz2K8ouUhu266OrpRKSZHEYtIjY2WE47tdY5o+f3Ahq+mITCu38z/uc3ByGRL0kuYj 1imGsx6uEfA2yL0X3zQbk+nGysJvnYLL7q2xylQGQaYczt9PNZ0uOxOYLdrzd9dFX9BX JexFSbn4xmXiZpjq1VVKdJ17lzhH8t8gJz5nhxndxb4avVVfVV6U2NZDFIhQ7PJCPws9 oDIqHHfDnJnwW3wMyoR0aXDjsfgdiXwhOTVQQXBz6FKqBT3IeWINwOaMr5qnbnHMArme xY+g== X-Gm-Message-State: AO0yUKWK1efPAd44X1QEpLtbIetBsMFTBqQbjx8Vvj+2x902igS6MRZM NNiYd0ldAl5XTWtv88e9Pv9cug== X-Received: by 2002:a05:600c:c4:b0:3ed:b048:73f4 with SMTP id u4-20020a05600c00c400b003edb04873f4mr1903820wmm.5.1679648924434; Fri, 24 Mar 2023 02:08:44 -0700 (PDT) Received: from [192.168.69.115] ([176.176.152.149]) by smtp.gmail.com with ESMTPSA id z5-20020a7bc7c5000000b003ee1b2ab9a0sm4306039wmk.11.2023.03.24.02.08.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Mar 2023 02:08:43 -0700 (PDT) Message-ID: <1722e75c-bc06-4a34-5e12-fa3622ed86a3@linaro.org> Date: Fri, 24 Mar 2023 10:08:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v7 6/6] PCI: Make use of pci_resource_n() Content-Language: en-US To: Andy Shevchenko , =?UTF-8?Q?Micka=c3=abl_Sala=c3=bcn?= , Mika Westerberg , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Michael Ellerman , Randy Dunlap , Arnd Bergmann , 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 References: <20230323173610.60442-1-andriy.shevchenko@linux.intel.com> <20230323173610.60442-7-andriy.shevchenko@linux.intel.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: <20230323173610.60442-7-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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 23/3/23 18:36, Andy Shevchenko wrote: > Replace open-coded implementations of pci_resource_n() in pci.h. > > Signed-off-by: Andy Shevchenko > --- > include/linux/pci.h | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/include/linux/pci.h b/include/linux/pci.h > index 70a4684d5f26..9539cf63fe5e 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -2006,14 +2006,12 @@ int pci_iobar_pfn(struct pci_dev *pdev, int bar, struct vm_area_struct *vma); > * for accessing popular PCI BAR info > */ > #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()". Here as #6 or as #2: Reviewed-by: Philippe Mathieu-Daudé