[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230811110702.31019-2-zhengzengkai@huawei.com>
Date: Fri, 11 Aug 2023 19:06:58 +0800
From: Zheng Zengkai <zhengzengkai@...wei.com>
To: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <mark.einon@...il.com>, <siva.kallam@...adcom.com>,
<prashant@...adcom.com>, <mchan@...adcom.com>,
<steve.glendinning@...well.net>, <mw@...ihalf.com>,
<jiawenwu@...stnetic.com>, <mengyuanlou@...-swift.com>
CC: <netdev@...r.kernel.org>, <wangxiongfeng2@...wei.com>,
<zhengzengkai@...wei.com>
Subject: [PATCH net-next 1/5] et131x: Use pci_dev_id() to simplify the code
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: Zheng Zengkai <zhengzengkai@...wei.com>
---
drivers/net/ethernet/agere/et131x.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/agere/et131x.c b/drivers/net/ethernet/agere/et131x.c
index 5fab589b3ddf..3d9220f9c9fe 100644
--- a/drivers/net/ethernet/agere/et131x.c
+++ b/drivers/net/ethernet/agere/et131x.c
@@ -3982,8 +3982,7 @@ static int et131x_pci_setup(struct pci_dev *pdev,
}
adapter->mii_bus->name = "et131x_eth_mii";
- snprintf(adapter->mii_bus->id, MII_BUS_ID_SIZE, "%x",
- (adapter->pdev->bus->number << 8) | adapter->pdev->devfn);
+ snprintf(adapter->mii_bus->id, MII_BUS_ID_SIZE, "%x", pci_dev_id(adapter->pdev));
adapter->mii_bus->priv = netdev;
adapter->mii_bus->read = et131x_mdio_read;
adapter->mii_bus->write = et131x_mdio_write;
--
2.20.1
Powered by blists - more mailing lists