public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* drivers/pci/probe.c compile warnings on -tip
@ 2008-10-01  8:02 Steven Noonan
  2008-10-01 10:47 ` Mikael Pettersson
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Noonan @ 2008-10-01  8:02 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Jeremy Fitzhardinge, H. Peter Anvin,
	Thomas Gleixner, Andrew Morton, Hugh Dickins, Jesse Barnes

I was hunting down some warnings I got when compiling -tip, and with
one of them, I'm not sure what would be a proper way to handle it.

If CONFIG_PHYS_ADDR_T_64BIT is not enabled, these warnings show up:

drivers/pci/probe.c: In function '__pci_read_base':
drivers/pci/probe.c:308: warning: format '%llx' expects type 'long
long unsigned int', but argument 4 has type 'resource_size_t'
drivers/pci/probe.c:308: warning: format '%llx' expects type 'long
long unsigned int', but argument 5 has type 'resource_size_t'
drivers/pci/probe.c:320: warning: format '%llx' expects type 'long
long unsigned int', but argument 5 has type 'resource_size_t'
drivers/pci/probe.c:320: warning: format '%llx' expects type 'long
long unsigned int', but argument 6 has type 'resource_size_t'
drivers/pci/probe.c: In function 'pci_read_bridge_bases':
drivers/pci/probe.c:392: warning: format '%llx' expects type 'long
long unsigned int', but argument 3 has type 'resource_size_t'
drivers/pci/probe.c:392: warning: format '%llx' expects type 'long
long unsigned int', but argument 4 has type 'resource_size_t'
drivers/pci/probe.c:405: warning: format '%llx' expects type 'long
long unsigned int', but argument 3 has type 'resource_size_t'
drivers/pci/probe.c:405: warning: format '%llx' expects type 'long
long unsigned int', but argument 4 has type 'resource_size_t'
drivers/pci/probe.c:443: warning: format '%llx' expects type 'long
long unsigned int', but argument 4 has type 'resource_size_t'
drivers/pci/probe.c:443: warning: format '%llx' expects type 'long
long unsigned int', but argument 5 has type 'resource_size_t'


Each of the lines is something like this:

printk(KERN_DEBUG "PCI: %s reg %x 64bit mmio: [%llx, %llx]\n",
pci_name(dev), pos, res->start, res->end);

res->start and res->end are resource_size_t (which is phys_addr_t),
and are sized either 32-bit or 64-bit, based on whether
CONFIG_PHYS_ADDR_T_64BIT is set. So, it seems to me that something
like these would be horrendously bad solutions (for obvious reasons,
like readability):

#ifdef CONFIG_PHYS_ADDR_T_64BIT
printk(KERN_DEBUG "PCI: %s reg %x 64bit mmio: [%llx, %llx]\n",
pci_name(dev), pos, res->start, res->end);
#else
printk(KERN_DEBUG "PCI: %s reg %x 64bit mmio: [%lx, %lx]\n",
pci_name(dev), pos, res->start, res->end);
#endif

or

#ifdef CONFIG_PHYS_ADDR_T_64BIT
printk(KERN_DEBUG "PCI: %s reg %x 64bit mmio: [%llx, %llx]\n",
pci_name(dev), pos, res->start, res->end);
#endif

What's the appropriate way to handle it? Moreover, are those printk's
even truly necessary?

- Steven

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-10-06  6:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-01  8:02 drivers/pci/probe.c compile warnings on -tip Steven Noonan
2008-10-01 10:47 ` Mikael Pettersson
2008-10-01 15:51   ` Jesse Barnes
2008-10-05  3:55     ` Steven Noonan
2008-10-05 10:18       ` Ingo Molnar
2008-10-05 18:06         ` Yinghai Lu
2008-10-06  6:21           ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox