]> git.karo-electronics.de Git - karo-tx-linux.git/commit
PCI: Fix warning in drivers/pci/probe.c on sparc64
authorDavid S. Miller <davem@davemloft.net>
Tue, 24 May 2011 00:12:22 +0000 (17:12 -0700)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 31 May 2011 21:29:26 +0000 (14:29 -0700)
commit5aceca9d3cbdacbd017712513387d930f9f944d9
tree026fbf89f4f5e077d865561b631bcc5210f32871
parentaf0d6a0a3a30946f7df69c764791f1b0643f7cd6
PCI: Fix warning in drivers/pci/probe.c on sparc64

IO_SPACE_LIMIT is currently used in two ways:

1) As a way to mask I/O port values read out of PCI base address
   registers.  This value should be 64-bit.

2) As a value which is the upper limit for all I/O "ports" in the
   system.

On sparc64 we store the full 64-bit physical I/O address in the
resources.  For this reason we define IO_SPACE_LIMIT at a 64-bit
"all 1's".

This is the right value to use for ioport_resource.end and for the
check made in drivers/pcmcia/rsrc_nonstatic.c:adjust_io().

But in driver/pci/probe.c:__pci_read_base() we mask this against
a "u32" variable and thus get the following warning:

drivers/pci/probe.c: In function ¡__pci_read_base¢:
drivers/pci/probe.c:207: warning: large integer implicitly truncated to unsigned type

Fix this by using an explicit "u32" cast.

I considered changing sparc64 to define a 32-bit "all 1's" like
most other systems do, but this wouldn't work because the checks
in PCMCIA's rsrc_nonstatic.c would no longer be right since they
are testing against fully formed 64-bit resources.  As described
above, on sparc64 such resources will hold full 64-bit physical
I/O addresses, not bus-centric 32-bit ones.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/probe.c