From: Randy Dunlap <randy.dunlap@oracle.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>,
Stephen Rothwell <sfr@canb.auug.org.au>, mingo <mingo@redhat.com>,
tglx <tglx@linutronix.de>,
linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: linux-next: Tree for April 10 (arch/x86)
Date: Mon, 14 Apr 2008 15:28:31 -0700 [thread overview]
Message-ID: <20080414152831.9b9753c1.randy.dunlap@oracle.com> (raw)
In-Reply-To: <20080414084048.GD23259@devserv.devel.redhat.com>
On Mon, 14 Apr 2008 04:40:49 -0400 Jakub Jelinek wrote:
> On Fri, Apr 11, 2008 at 08:19:01AM -0700, Randy Dunlap wrote:
> > On Fri, 11 Apr 2008 09:46:31 +0200 Ingo Molnar wrote:
> >
> > >
> > > * Randy Dunlap <randy.dunlap@oracle.com> wrote:
> > >
> > > > Fix printk formats in x86/mm/ioremap.c:
> > > >
> > > > next-20080410/arch/x86/mm/ioremap.c:137: warning: format '%llx' expects type 'long long unsigned int', but argument 2 has type 'resource_size_t'
> > > > next-20080410/arch/x86/mm/ioremap.c:188: warning: format '%llx' expects type 'long long unsigned int', but argument 2 has type 'resource_size_t'
> > > > next-20080410/arch/x86/mm/ioremap.c:188: warning: format '%llx' expects type 'long long unsigned int', but argument 3 has type 'long unsigned int'
> > >
> > > thanks, applied.
> > >
> > > > if (!phys_addr_valid(phys_addr)) {
> > > > printk(KERN_WARNING "ioremap: invalid physical address %llx\n",
> > > > - phys_addr);
> > > > + (unsigned long long)phys_addr);
> > >
> > > is there really no way to solve this more cleanly than a forced cast?
> >
> > I haven't seen any other decent solutions. This is what we do
> > all over the kernel.
>
> You can define macros and use them in the format string.
> In this case
> printk(KERN_WARNING "ioremap: invalid physical address %" PRIRESOURCESZ "\n",
> phys_addr);
> (see the PRI* macros in
> http://www.opengroup.org/onlinepubs/009695399/basedefs/inttypes.h.html
> and e.g. glibc inttypes.h to see how it is defined). Other alternative is
> custom format length modifiers, but unfortunately there is no easy way ATM
> to teach GCC about them.
Hi,
I tried this.
In this particular case, phys_addr is a type(def) of resource_size_t,
so we still get gcc warnings:
next-20080410/arch/x86/mm/ioremap.c: In function '__ioremap':
next-20080410/arch/x86/mm/ioremap.c:137: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'resource_size_t'
next-20080410/arch/x86/mm/ioremap.c:188: warning: format '%lx' expects type 'long unsigned int', but argument 2 has type 'resource_size_t'
so we still need to cast phys_addr either to (unsigned long) or
(unsigned long long). Rigth? or am I missing something? if so, what?
Thanks,
---
~Randy
prev parent reply other threads:[~2008-04-14 22:29 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-10 8:14 linux-next: Tree for April 10 Stephen Rothwell
2008-04-10 10:24 ` [BUG] linux-next: Tree for April 10 - kernel panic while loading ata driver on powermac Kamalesh Babulal
2008-04-10 10:45 ` Jeff Garzik
2008-04-10 11:02 ` Kamalesh Babulal
2008-04-10 11:32 ` Alan Cox
2008-04-10 12:14 ` Jeff Garzik
2008-04-10 12:03 ` Bartlomiej Zolnierkiewicz
2008-04-10 17:14 ` Bartlomiej Zolnierkiewicz
2008-04-10 18:25 ` Kamalesh Babulal
2008-04-10 19:16 ` Bartlomiej Zolnierkiewicz
2008-04-10 17:42 ` linux-next: Tree for April 10 Greg KH
2008-04-10 18:07 ` [BUG] linux-next: April 10 - kernel oops at kmem_cache_alloc () regression from April 9 kernel Kamalesh Babulal
2008-04-11 17:56 ` Suresh Siddha
2008-04-14 13:14 ` Kamalesh Babulal
2008-04-10 19:34 ` linux-next: Tree for April 10: generic pci_enable_resources() strikes again Mariusz Kozlowski
2008-04-14 1:48 ` Stephen Rothwell
2008-04-14 4:28 ` Greg KH
2008-04-14 4:49 ` Stephen Rothwell
2008-04-10 22:07 ` linux-next: Tree for April 10 (ftrace) Randy Dunlap
2008-04-10 22:09 ` linux-next: Tree for April 10 (arch/x86) Randy Dunlap
2008-04-11 7:46 ` Ingo Molnar
2008-04-11 15:19 ` Randy Dunlap
2008-04-11 15:26 ` Al Viro
2008-04-14 8:12 ` Ingo Molnar
2008-04-14 8:22 ` Al Viro
2008-04-14 8:34 ` Ingo Molnar
2008-04-14 8:43 ` Jakub Jelinek
2008-04-14 9:30 ` Al Viro
2008-04-14 9:37 ` David Miller
2008-04-14 8:40 ` Jakub Jelinek
2008-04-14 22:28 ` Randy Dunlap [this message]
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=20080414152831.9b9753c1.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=jakub@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=sfr@canb.auug.org.au \
--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
all inboxes | Powered by JetHome®