lkml.org 
[lkml]   [2010]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mmotm] 8250_early: fix printk format warnings
On Fri,  9 Jul 2010 14:47:52 +0900 (JST)
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:

> > From: Randy Dunlap <randy.dunlap@oracle.com>
> >
> > Fix printk format warnings in serial-mmio32-support-for-8250_earlyc.patch:
> >
> > drivers/serial/8250_early.c:207: warning: format '%p' expects type 'void *', but argument 3 has type 'long long unsigned int'
> > drivers/serial/8250_early.c:210: warning: format '%p' expects type 'void *', but argument 2 has type 'long long unsigned int'
> >
> > Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> > Cc: Samium Gromoff <_deepfire@feelingofgreen.ru>
> > Cc: Greg KH <greg@kroah.com>
> > ---
> > drivers/serial/8250_early.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > --- mmotm-2010-0701-1219.orig/drivers/serial/8250_early.c
> > +++ mmotm-2010-0701-1219/drivers/serial/8250_early.c
> > @@ -202,12 +202,12 @@ static int __init parse_options(struct e
> > }
> >
> > if (mmio || mmio32)
> > - printk(KERN_INFO "Early serial console at MMIO%s 0x%p (options '%s')\n",
> > + printk(KERN_INFO "Early serial console at MMIO%s 0x%llu (options '%s')\n",
> > mmio32 ? "32" : "", (unsigned long long) port->mapbase,
> > device->options);
> > else
> > printk(KERN_INFO "Early serial console at I/O port 0x%pr (options '%s')\n",
> > - (unsigned long long) port->iobase, device->options);
> > + (void *) port->iobase, device->options);
>
> seems still odd.

Yes.

> %pr don't mean bare pointer. it want resource. another %pr use case is here.
>
> drivers/pnp/resoruce.c
> ======================================================================
> struct pnp_resource *pnp_add_dma_resource(struct pnp_dev *dev, int dma,
> int flags)
> {
> struct pnp_resource *pnp_res;
> struct resource *res;
> (snip)
> pnp_dbg(&dev->dev, " add %pr\n", res);
> ======================================================================
>
> and port->iobase is merely unsingned long.
> I guess following change or something like are necessary.
>
> - printk(KERN_INFO "Early serial console at I/O port 0x%pr (options '%s')\n",
> - (unsigned long long) port->iobase, device->options);
> + printk(KERN_INFO "Early serial console at I/O port %lu (options '%s')\n",
> + port->iobase, device->options);
>

This?

if (mmio || mmio32)
printk(KERN_INFO
"Early serial console at MMIO%s 0x%llu (options '%s')\n",
mmio32 ? "32" : "",
(unsigned long long)port->mapbase,
device->options);
else
printk(KERN_INFO
"Early serial console at I/O port 0x%lu (options '%s')\n",
port->iobase,
device->options);



\
 
 \ /
  Last update: 2010-07-10 00:49    [W:0.109 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site