lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4C3A7D24.1050008@oracle.com>
Date:	Sun, 11 Jul 2010 19:25:40 -0700
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
CC:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	Samium Gromoff <_deepfire@...lingofgreen.ru>,
	Greg KH <greg@...ah.com>
Subject: Re: [PATCH -mmotm] 8250_early: fix printk format warnings

On 07/08/10 22:47, KOSAKI Motohiro wrote:
>> From: Randy Dunlap <randy.dunlap@...cle.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@...cle.com>
>> Cc: Samium Gromoff <_deepfire@...lingofgreen.ru>
>> Cc: Greg KH <greg@...ah.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 ***
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ