From: Frederic Barrat <fbarrat@linux.ibm.com>
To: Zheng Zengkai <zhengzengkai@huawei.com>,
ajd@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
christophe.leroy@csgroup.eu
Cc: linuxppc-dev@lists.ozlabs.org, wangxiongfeng2@huawei.com
Subject: Re: [PATCH] ocxl: Use pci_dev_id() to simplify the code
Date: Fri, 11 Aug 2023 15:00:28 +0200 [thread overview]
Message-ID: <ebceb9a2-3eac-4166-bb0e-6b58338b22b5@linux.ibm.com> (raw)
In-Reply-To: <20230811102039.17257-1-zhengzengkai@huawei.com>
On 11/08/2023 12:20, Zheng Zengkai wrote:
> PCI core API pci_dev_id() can be used to get the BDF number for a pci
> device. We don't need to compose it mannually. Use pci_dev_id() to
> simplify the code a little bit.
>
> Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com>
> ---
LGTM
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
Fred
> arch/powerpc/platforms/powernv/ocxl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/powernv/ocxl.c b/arch/powerpc/platforms/powernv/ocxl.c
> index 629067781cec..64a9c7125c29 100644
> --- a/arch/powerpc/platforms/powernv/ocxl.c
> +++ b/arch/powerpc/platforms/powernv/ocxl.c
> @@ -449,7 +449,7 @@ int pnv_ocxl_spa_setup(struct pci_dev *dev, void *spa_mem, int PE_mask,
> if (!data)
> return -ENOMEM;
>
> - bdfn = (dev->bus->number << 8) | dev->devfn;
> + bdfn = pci_dev_id(dev);
> rc = opal_npu_spa_setup(phb->opal_id, bdfn, virt_to_phys(spa_mem),
> PE_mask);
> if (rc) {
next prev parent reply other threads:[~2023-08-11 13:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 10:20 [PATCH] ocxl: Use pci_dev_id() to simplify the code Zheng Zengkai
2023-08-11 13:00 ` Frederic Barrat [this message]
2023-08-14 7:07 ` Andrew Donnellan
2023-08-23 11:55 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ebceb9a2-3eac-4166-bb0e-6b58338b22b5@linux.ibm.com \
--to=fbarrat@linux.ibm.com \
--cc=ajd@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=wangxiongfeng2@huawei.com \
--cc=zhengzengkai@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).