• A
    [PATCH] fix drivers/pci/probe.c warning · 3c6de929
    Amos Waterland 提交于
    This function expects an unsigned 32-bit type as its third argument:
    
     static u32 pci_size(u32 base, u32 maxbase, u32 mask)
    
    However, given these definitions:
    
     #define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
     #define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
    
    these two calls in drivers/pci/probe.c are problematic for architectures
    for which a UL is not equivalent to a u32:
    
     sz = pci_size(l, sz, PCI_BASE_ADDRESS_MEM_MASK);
     sz = pci_size(l, sz, PCI_ROM_ADDRESS_MASK);
    
    Hence the below compile warning when building for ARCH=ppc64:
    
     drivers/pci/probe.c: In function `pci_read_bases':
     /.../probe.c:168: warning: large integer implicitly truncated to unsigned type
     /.../probe.c:218: warning: large integer implicitly truncated to unsigned type
    
    Here is a simple fix.
    Signed-off-by: NAmos Waterland <apw@us.ibm.com>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
    Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
    3c6de929
probe.c 26.5 KB