All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	Samium Gromoff <_deepfire@feelingofgreen.ru>,
	Greg KH <greg@kroah.com>
Subject: Re: [PATCH -mmotm] 8250_early: fix printk format warnings
Date: Sun, 11 Jul 2010 19:25:40 -0700	[thread overview]
Message-ID: <4C3A7D24.1050008@oracle.com> (raw)
In-Reply-To: <20100709144148.3D25.A69D9226@jp.fujitsu.com>

On 07/08/10 22:47, KOSAKI Motohiro 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);

so why was this one using "%pr" at all?

> 
> seems still odd.
> 
> %pr don't mean bare pointer. it want resource. another %pr use case is here.

%p<X> still wants some pointer, not an (unsigned long long).
Yes, %pr should be giving a struct resource * instead of a void *.


> 
> 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);

Yes, that works too.  Thanks.

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

  parent reply	other threads:[~2010-07-12  2:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 19:19 mmotm 2010-07-01-12-19 uploaded akpm
2010-07-01 23:28 ` mmotm 2010-07-01-12-19 uploaded (mmc) Randy Dunlap
2010-07-07 21:36   ` Andrew Morton
2010-07-02  9:26 ` mmotm 2010-07-01-12-19 uploaded Xiaotian Feng
2010-07-02 18:24   ` Andrew Morton
2010-07-02 18:24   ` Andrew Morton
2010-07-03  1:24 ` [PATCH -mmotm] 8250_early: fix printk format warnings Randy Dunlap
2010-07-08 18:37   ` Greg KH
2010-07-08 18:45     ` Randy Dunlap
2010-07-08 18:55       ` Greg KH
2010-07-09  5:47   ` KOSAKI Motohiro
2010-07-09 22:46     ` Andrew Morton
2010-07-12  1:18       ` KOSAKI Motohiro
2010-07-12  2:25     ` Randy Dunlap [this message]
2010-07-05 20:35 ` mmotm 2010-07-01 pm_get_wakeup_count() declaration Valdis.Kletnieks
2010-07-05 20:35 ` Valdis.Kletnieks
2010-07-05 20:43   ` Rafael J. Wysocki
2010-07-06  2:24     ` Valdis.Kletnieks
2010-07-06 18:06       ` Rafael J. Wysocki
2010-07-06 18:06       ` Rafael J. Wysocki
2010-07-06  2:24     ` Valdis.Kletnieks
2010-07-05 20:43   ` Rafael J. Wysocki

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=4C3A7D24.1050008@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=_deepfire@feelingofgreen.ru \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.