diff mbox series

[-next] net: txgbe: use pci_dev_id() helper

Message ID 20240826012100.3975175-1-liaoyu15@huawei.com (mailing list archive)
State Accepted
Commit d76867efebcb20752345e5a41d38bd456427b325
Delegated to: Netdev Maintainers
Headers show
Series [-next] net: txgbe: use pci_dev_id() helper | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 16 this patch: 16
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 16 this patch: 16
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 16 this patch: 16
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-08-26--03-00 (tests: 714)

Commit Message

Yu Liao Aug. 26, 2024, 1:21 a.m. UTC
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 manually. Use pci_dev_id() to
simplify the code a little bit.

Signed-off-by: Yu Liao <liaoyu15@huawei.com>
---
 drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Simon Horman Aug. 27, 2024, 2:42 p.m. UTC | #1
On Mon, Aug 26, 2024 at 09:21:00AM +0800, Yu Liao 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 manually. Use pci_dev_id() to
> simplify the code a little bit.
> 
> Signed-off-by: Yu Liao <liaoyu15@huawei.com>

Thanks Yu Liao,

I agree that pci_dev_id() was being open coded here.
And that it is nicer to use that helper.

Reviewed-by: Simon Horman <horms@kernel.org>
patchwork-bot+netdevbpf@kernel.org Aug. 27, 2024, 9:30 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 26 Aug 2024 09:21:00 +0800 you 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 manually. Use pci_dev_id() to
> simplify the code a little bit.
> 
> Signed-off-by: Yu Liao <liaoyu15@huawei.com>
> ---
>  drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Here is the summary with links:
  - [-next] net: txgbe: use pci_dev_id() helper
    https://git.kernel.org/netdev/net-next/c/d76867efebcb

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
index 5f502265f0a6..67b61afdde96 100644
--- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
+++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c
@@ -688,8 +688,7 @@  static int txgbe_ext_phy_init(struct txgbe *txgbe)
 	mii_bus->parent = &pdev->dev;
 	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);
+	snprintf(mii_bus->id, MII_BUS_ID_SIZE, "txgbe-%x", pci_dev_id(pdev));
 
 	ret = devm_mdiobus_register(&pdev->dev, mii_bus);
 	if (ret) {