* Bit Truncation in drivers/pci/probe.c on amd64
@ 2005-09-03 1:53 Gabriel A. Devenyi
0 siblings, 0 replies; 2+ messages in thread
From: Gabriel A. Devenyi @ 2005-09-03 1:53 UTC (permalink / raw)
To: linux-kernel
In the current git repository, on my amd64 machine I get the following warning on compile
drivers/pci/probe.c: In function `pci_read_bases':
drivers/pci/probe.c:166: warning: large integer implicitly truncated to unsigned type
drivers/pci/probe.c:216: warning: large integer implicitly truncated to unsigned type
I've tracked this down to pci_size, and two #define's in include/linux/pci.h
#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
pci_size expects 3 u32 arguments,but from what I can tell, on 64 bit arch's the two above
defines expand to 64bit values, and are truncated when being passed.
I'm not sure how to go about fixing this, if pci_size should accept a u64 or if the defines should
be changed. Is this bug dangerous? What should be done to fix it?
--
Gabriel Devenyi
ace@staticwave.ca
^ permalink raw reply [flat|nested] 2+ messages in thread
* Bit Truncation in drivers/pci/probe.c on amd64
@ 2005-09-06 1:15 Gabriel A. Devenyi
0 siblings, 0 replies; 2+ messages in thread
From: Gabriel A. Devenyi @ 2005-09-06 1:15 UTC (permalink / raw)
To: linux-kernel; +Cc: kernel-janitors
In the current git repository, on my amd64 machine I get the following warning on compile
drivers/pci/probe.c: In function `pci_read_bases':
drivers/pci/probe.c:166: warning: large integer implicitly truncated to unsigned type
drivers/pci/probe.c:216: warning: large integer implicitly truncated to unsigned type
I've tracked this down to pci_size, and two #define's in include/linux/pci.h
#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
pci_size expects 3 u32 arguments,but from what I can tell, on 64 bit arch's the two above
defines expand to 64bit values, and are truncated when being passed.
I'm not sure how to go about fixing this, if pci_size should accept a u64 or if the defines should
be changed. Is this bug dangerous? What should be done to fix it?
--
Gabriel A. Devenyi
ace@staticwave.ca
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-09-06 1:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-03 1:53 Bit Truncation in drivers/pci/probe.c on amd64 Gabriel A. Devenyi
-- strict thread matches above, loose matches on Subject: below --
2005-09-06 1:15 Gabriel A. Devenyi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox