public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: Rene Herman <rene.herman@keyaccess.nl>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>,
	Joe Perches <joe@perches.com>,
	linux-next@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
	akpm <akpm@linux-foundation.org>
Subject: Re: [PATCH -next] PNP: fix printk format warnings
Date: Sun, 04 May 2008 14:05:57 -0700	[thread overview]
Message-ID: <481E2535.8080301@oracle.com> (raw)
In-Reply-To: <481E0C13.9010907@keyaccess.nl>

Rene Herman wrote:
> On 30-04-08 23:07, Joe Perches wrote:
> 
>> On Wed, 2008-04-30 at 13:56 -0700, Randy Dunlap wrote:
>>> From: Randy Dunlap <randy.dunlap@oracle.com>
>>>
>>> next-20080430/drivers/pnp/pnpbios/rsparser.c:594: warning: format 
>>> '%d' expects type 'int', but argument 4 has type 'resource_size_t'
>>> next-20080430/drivers/pnp/pnpbios/rsparser.c:605: warning: format 
>>> '%d' expects type 'int', but argument 4 has type 'resource_size_t'
>>
>> resource_size_t can be u64
>> I think you need %llu/(unsigned long long)
>>
>> --- next-20080430.orig/drivers/pnp/pnpbios/rsparser.c
>> +++ next-20080430/drivers/pnp/pnpbios/rsparser.c
>> @@ -591,7 +591,7 @@ static void pnpbios_encode_irq(struct pn
>>      p[1] = map & 0xff;
>>      p[2] = (map >> 8) & 0xff;
>>  
>> -    dev_dbg(&dev->dev, "  encode irq %d\n", res->start);
>> +    dev_dbg(&dev->dev, "  encode irq %llu\n", (unsigned long 
>> long)res->start);
>>  }
>>  
>>  static void pnpbios_encode_dma(struct pnp_dev *dev, unsigned char *p,
>> @@ -602,7 +602,7 @@ static void pnpbios_encode_dma(struct pn
>>      map = 1 << res->start;
>>      p[1] = map & 0xff;
>>  
>> -    dev_dbg(&dev->dev, "  encode dma %d\n", res->start);
>> +    dev_dbg(&dev->dev, "  encode dma %llu\n", (unsigned long 
>> long)res->start);
>>  }
>>  
>>  static void pnpbios_encode_port(struct pnp_dev *dev, unsigned char *p,
> 
> Bjorn? Could swear I previously saw patches that just did an (int) cast 
> here...

My original patch did (int) cast but Joe suggested using
unsigned long long.  I didn't expect DMA channel or irq to be anywhere
near that large, so I thought that (int) would be sufficient,
at the same time recognizing that it does/could truncate the value,
while ull won't truncate.

-- 
~Randy

  reply	other threads:[~2008-05-04 21:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30 20:56 [PATCH -next] PNP: fix printk format warnings Randy Dunlap
2008-04-30 21:07 ` Joe Perches
2008-04-30 21:25   ` Randy Dunlap
2008-05-04 19:18   ` Rene Herman
2008-05-04 21:05     ` Randy Dunlap [this message]
2008-05-04 21:40       ` Rene Herman

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=481E2535.8080301@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=rene.herman@keyaccess.nl \
    /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