diff options
author | Ren Zhijie <renzhijie2@huawei.com> | 2022-09-19 04:58:40 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-09-21 01:47:49 +0200 |
commit | 54b9a2bb6c013a34cfdb5a6241367b003773662f (patch) | |
tree | fc6f1a24fdf28abad1ea4a23778ecebfe85bf8cd /drivers/net | |
parent | ice: Add low latency Tx timestamp read (diff) | |
download | linux-54b9a2bb6c013a34cfdb5a6241367b003773662f.tar.xz linux-54b9a2bb6c013a34cfdb5a6241367b003773662f.zip |
octeontx2-pf: Fix unused variable build error
If CONFIG_DCB is not set,
make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-,
will be failed, like this:
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c: In function ‘otx2_select_queue’:
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:1886:19: error: unused variable ‘pf’ [-Werror=unused-variable]
struct otx2_nic *pf = netdev_priv(netdev);
^~
cc1: all warnings being treated as errors
To fix this build error, put the definition of *pf under the CONFIG_DCB.
Fixes: 99c969a83d82 ("octeontx2-pf: Add egress PFC support")
Signed-off-by: Ren Zhijie <renzhijie2@huawei.com>
Link: https://lore.kernel.org/r/20220919025840.256411-1-renzhijie2@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c index 8bf5274cd7e3..88ce472959b0 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c @@ -1883,8 +1883,8 @@ static netdev_tx_t otx2_xmit(struct sk_buff *skb, struct net_device *netdev) static u16 otx2_select_queue(struct net_device *netdev, struct sk_buff *skb, struct net_device *sb_dev) { - struct otx2_nic *pf = netdev_priv(netdev); #ifdef CONFIG_DCB + struct otx2_nic *pf = netdev_priv(netdev); u8 vlan_prio; #endif |