public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Mikael Pettersson <mikpe@it.uu.se>
Cc: "Steven Noonan" <steven@uplinklabs.net>,
	"Ingo Molnar" <mingo@elte.hu>,
	linux-kernel@vger.kernel.org,
	"Jeremy Fitzhardinge" <jeremy@goop.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Hugh Dickins" <hugh@veritas.com>
Subject: Re: drivers/pci/probe.c compile warnings on -tip
Date: Wed, 1 Oct 2008 08:51:15 -0700	[thread overview]
Message-ID: <200810010851.15969.jbarnes@virtuousgeek.org> (raw)
In-Reply-To: <18659.21853.41967.715062@harpo.it.uu.se>

On Wednesday, October 1, 2008 3:47 am Mikael Pettersson wrote:
> Steven Noonan writes:
>  > 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.
>
> Oh not those again. Similar warnings in 27-rc's drivers/pci
> were fixed recently, but apparently someone out there likes
> to create new ones.
>
> The fix is to cast the resource_size_t arguments to unsigned long long.
> With "%llx" that's the /only/ valid argument type.
>
> Also note that these warnings aren't harmless. On 32-bit machines
> with parameters passed on the stack the mismatch in size between
> 32-bit resource_size_t and the 64-bit %llx causes undefined
> behaviour as printk mis-enumerates its parameters.

AFAICT, these are fixed in Linus' tree, maybe the x86 tree needs an update?

-- 
Jesse Barnes, Intel Open Source Technology Center

  reply	other threads:[~2008-10-01 15:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200810010851.15969.jbarnes@virtuousgeek.org \
    --to=jbarnes@virtuousgeek.org \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=hugh@veritas.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@it.uu.se \
    --cc=mingo@elte.hu \
    --cc=steven@uplinklabs.net \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox