Skip to content

Commit dc1d7b3

Browse files
ij-intelmartinkpetersen
authored andcommitted
scsi: qla2xxx: Use FIELD_GET() to extract PCIe capability fields
Use FIELD_GET() to extract PCIe capability registers field instead of custom masking and shifting. Signed-off-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Jonathan Cameron <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 5532f24 commit dc1d7b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
#include "qla_def.h"
77

8+
#include <linux/bitfield.h>
89
#include <linux/moduleparam.h>
910
#include <linux/vmalloc.h>
1011
#include <linux/delay.h>
@@ -633,8 +634,8 @@ qla24xx_pci_info_str(struct scsi_qla_host *vha, char *str, size_t str_len)
633634
const char *speed_str;
634635

635636
pcie_capability_read_dword(ha->pdev, PCI_EXP_LNKCAP, &lstat);
636-
lspeed = lstat & PCI_EXP_LNKCAP_SLS;
637-
lwidth = (lstat & PCI_EXP_LNKCAP_MLW) >> 4;
637+
lspeed = FIELD_GET(PCI_EXP_LNKCAP_SLS, lstat);
638+
lwidth = FIELD_GET(PCI_EXP_LNKCAP_MLW, lstat);
638639

639640
switch (lspeed) {
640641
case 1:

0 commit comments

Comments
 (0)