Skip to content

Commit 04e82fa

Browse files
committed
PCI: Use FIELD_GET() in Sapphire RX 5600 XT Pulse quirk
Use FIELD_GET() to remove dependences on the field position, i.e., the shift value. No functional change intended. Separate because this isn't as trivial as the other FIELD_GET() changes. See 907830b ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]> Cc: Nirmoy Das <[email protected]>
1 parent e0f0a16 commit 04e82fa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/pci/pci.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3750,14 +3750,14 @@ u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar)
37503750
return 0;
37513751

37523752
pci_read_config_dword(pdev, pos + PCI_REBAR_CAP, &cap);
3753-
cap &= PCI_REBAR_CAP_SIZES;
3753+
cap = FIELD_GET(PCI_REBAR_CAP_SIZES, cap);
37543754

37553755
/* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */
37563756
if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
3757-
bar == 0 && cap == 0x7000)
3758-
cap = 0x3f000;
3757+
bar == 0 && cap == 0x700)
3758+
return 0x3f00;
37593759

3760-
return cap >> 4;
3760+
return cap;
37613761
}
37623762
EXPORT_SYMBOL(pci_rebar_get_possible_sizes);
37633763

0 commit comments

Comments
 (0)