Skip to content

Commit 4f60116

Browse files
ij-intelanguy11
authored andcommitted
igb: Use FIELD_GET() to extract Link Width
Use FIELD_GET() to extract PCIe Negotiated Link Width field instead of custom masking and shifting. Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Pucha Himasekhar Reddy <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]>
1 parent 609c767 commit 4f60116

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ethernet/intel/igb/e1000_mac.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22
/* Copyright(c) 2007 - 2018 Intel Corporation. */
33

4+
#include <linux/bitfield.h>
45
#include <linux/if_ether.h>
56
#include <linux/delay.h>
67
#include <linux/pci.h>
@@ -50,9 +51,8 @@ s32 igb_get_bus_info_pcie(struct e1000_hw *hw)
5051
break;
5152
}
5253

53-
bus->width = (enum e1000_bus_width)((pcie_link_status &
54-
PCI_EXP_LNKSTA_NLW) >>
55-
PCI_EXP_LNKSTA_NLW_SHIFT);
54+
bus->width = (enum e1000_bus_width)FIELD_GET(PCI_EXP_LNKSTA_NLW,
55+
pcie_link_status);
5656
}
5757

5858
reg = rd32(E1000_STATUS);

0 commit comments

Comments
 (0)