PCI: handle 64-bit resources better on 32-bit machines

If the kernel is configured to support 64-bit resources on a 32-bit
machine, we can support 64-bit BARs properly. Just change the condition
to check sizeof(resource_size_t) instead of BITS_PER_LONG.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by

Matthew Wilcox and committed by
Jesse Barnes
cc5499c3 6ac665c6

+2 -2
+2 -2
drivers/pci/probe.c
··· 270 270 if (!sz64) 271 271 goto fail; 272 272 273 - if ((BITS_PER_LONG < 64) && (sz64 > 0x100000000ULL)) { 273 + if ((sizeof(resource_size_t) < 8) && (sz64 > 0x100000000ULL)) { 274 274 dev_err(&dev->dev, "can't handle 64-bit BAR\n"); 275 275 goto fail; 276 - } else if ((BITS_PER_LONG < 64) && l) { 276 + } else if ((sizeof(resource_size_t) < 8) && l) { 277 277 /* Address above 32-bit boundary; disable the BAR */ 278 278 pci_write_config_dword(dev, pos, 0); 279 279 pci_write_config_dword(dev, pos + 4, 0);