netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Zhang Zekun <zhangzekun11@huawei.com>
Cc: <jiawenwu@trustnetic.com>, <mengyuanlou@net-swift.com>,
	<avem@davemloft.net>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: txgbe: Simplify code with pci_dev_id()
Date: Wed, 4 Sep 2024 16:35:55 -0700	[thread overview]
Message-ID: <20240904163555.7a8812e9@kernel.org> (raw)
In-Reply-To: <20240903072301.117767-1-zhangzekun11@huawei.com>

On Tue, 3 Sep 2024 15:23:01 +0800 Zhang Zekun wrote:
> Use pci_dev_id() to get the BDF number of a pci device, and we don't
> calculate it manually. This can simplify the code a bit.
> 
> Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
> ---
>  drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> index 5f502265f0a6..e8e293b1dd61 100644
> --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
> @@ -689,7 +689,7 @@ static int txgbe_ext_phy_init(struct txgbe *txgbe)
>  	mii_bus->phy_mask = GENMASK(31, 1);
>  	mii_bus->priv = wx;
>  	snprintf(mii_bus->id, MII_BUS_ID_SIZE, "txgbe-%x",
> -		 (pdev->bus->number << 8) | pdev->devfn);
> +		 pci_dev_id(pdev));
>  
>  	ret = devm_mdiobus_register(&pdev->dev, mii_bus);
>  	if (ret) {

Already done and slightly more cleanly in d76867efebcb20752345
by who I presume is your coworker.

      reply	other threads:[~2024-09-04 23:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03  7:23 [PATCH net-next] net: txgbe: Simplify code with pci_dev_id() Zhang Zekun
2024-09-04 23:35 ` Jakub Kicinski [this message]

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=20240904163555.7a8812e9@kernel.org \
    --to=kuba@kernel.org \
    --cc=avem@davemloft.net \
    --cc=jiawenwu@trustnetic.com \
    --cc=mengyuanlou@net-swift.com \
    --cc=netdev@vger.kernel.org \
    --cc=zhangzekun11@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).