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 F344EC6FD20 for ; Fri, 24 Mar 2023 09:09:43 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Pjbxy3H0Tz3fCh for ; Fri, 24 Mar 2023 20:09:42 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=KF7vhgGU; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linaro.org (client-ip=2a00:1450:4864:20::332; helo=mail-wm1-x332.google.com; envelope-from=philmd@linaro.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=KF7vhgGU; dkim-atps=neutral Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Pjbwy6H4Bz3f8t for ; Fri, 24 Mar 2023 20:08:48 +1100 (AEDT) Received: by mail-wm1-x332.google.com with SMTP id o40-20020a05600c512800b003eddedc47aeso2697318wms.3 for ; Fri, 24 Mar 2023 02:08:48 -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=aWiA00diBvBQFyKg8fJC67j3CCQj8eqU19DK/57soCRq8FvrcQmY1QgKAxfRanPIrx opQFIBf5twOxcVhRksJn+ILalAo1S3WIh7mLEKirLzim52S31AVdU/fgo129Swa+K5sq aiLIF2dCwwmH3u4ohC+uUAqKiWU6b0vaYyBwtZ/BW7VU9ZllGYmHv9nrg51GxN1/OBvQ fmDbk9XuNidk0vZ1GydifEscCHFVhyO4wxqhg7uwDwaUUP3VQy888pHe0c67RmfR5bhd zJTOKv6nJvB5RDnYMNHYcrjtkYhjG+oNNf/3yuseg6+bnkMxE//HaMvZN18tPdjdVSIJ gEdQ== X-Gm-Message-State: AO0yUKUNHhJEoJ9J/bJcYytlP/BKzUw5cjHMHyZaHD3X/NcriCHQsbDW cI83TPLDZoDR6LEL3G7ztXgBiQ== X-Google-Smtp-Source: AK7set/vvjAUaOTR5nW6O5SRtNoHqTNaeTjKsckBwHxq1C38GOKprexc3eF5NaIoYwtOC0bG/ZduEw== 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 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-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: Andrew Lunn , Thomas Bogendoerfer , Stefano Stabellini , Yoshinori Sato , Oleksandr Tyshchenko , Gregory Clement , Richard Henderson , Russell King , Nicholas Piggin , Bjorn Helgaas , Rich Felker , Ivan Kokshaysky , John Paul Adrian Glaubitz , Miguel Ojeda , Matt Turner , Anatolij Gustschin , "David S. Miller" , Sebastian Hesselbarth Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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é