public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: "Randy.Dunlap" <rdunlap@xenotime.net>
Cc: lkml <linux-kernel@vger.kernel.org>, gregkh <greg@kroah.com>
Subject: Re: [PATCH -mm 5/5] usbnet: printk format warning
Date: Mon, 7 Aug 2006 20:29:45 -0700	[thread overview]
Message-ID: <20060807202945.48d7e86a.akpm@osdl.org> (raw)
In-Reply-To: <20060807155640.63e59e6b.rdunlap@xenotime.net>

On Mon, 7 Aug 2006 15:56:40 -0700
"Randy.Dunlap" <rdunlap@xenotime.net> wrote:

> Fix printk format warning(s):
> drivers/usb/net/usbnet.c:654: warning: int format, different type arg (arg 3)
> 
> Can't say that I understand this one...
> 
> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
> ---
>  drivers/usb/net/usbnet.c |    2 +-
>  1 files changed, 1 insertion(+), 1 deletion(-)
> 
> --- linux-2618-rc3mm2.orig/drivers/usb/net/usbnet.c
> +++ linux-2618-rc3mm2/drivers/usb/net/usbnet.c
> @@ -652,7 +652,7 @@ static int usbnet_open (struct net_devic
>  			framing = "simple";
>  
>  		devinfo (dev, "open: enable queueing "
> -				"(rx %d, tx %d) mtu %d %s framing",
> +				"(rx %ld, tx %d) mtu %u %s framing",
>  			RX_QLEN (dev), TX_QLEN (dev), dev->net->mtu,
>  			framing);

Your compiler wasn't very helpful.  Or maybe we get better diagnostics with
a 64-bit compiler:



From: Randy Dunlap <rdunlap@xenotime.net>

Fix printk format warning(s):

drivers/usb/net/usbnet.c: In function 'usbnet_open':
drivers/usb/net/usbnet.c:654: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'

The fact that rx_urb_size happens to be a size_t has propagated all the way
back to this printk.  It's fragile to be using %z in this case - let's just
typecast the args instead.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/usb/net/usbnet.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/usb/net/usbnet.c~usbnet-printk-format-warning drivers/usb/net/usbnet.c
--- a/drivers/usb/net/usbnet.c~usbnet-printk-format-warning
+++ a/drivers/usb/net/usbnet.c
@@ -653,7 +653,7 @@ static int usbnet_open (struct net_devic
 
 		devinfo (dev, "open: enable queueing "
 				"(rx %d, tx %d) mtu %d %s framing",
-			RX_QLEN (dev), TX_QLEN (dev), dev->net->mtu,
+			(int)RX_QLEN(dev), (int)TX_QLEN(dev), dev->net->mtu,
 			framing);
 	}
 
_


  parent reply	other threads:[~2006-08-08  3:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-07 22:47 [PATCH -mm 1/5] nbd: printk format warning Randy.Dunlap
2006-08-07 22:50 ` [PATCH -mm 2/5] cachefiles: " Randy.Dunlap
2006-08-07 22:52   ` [PATCH -mm 3/5] MTD: " Randy.Dunlap
2006-08-07 22:54     ` [PATCH -mm 4/5] scsi-target: printk format warnings Randy.Dunlap
2006-08-07 22:56       ` [PATCH -mm 5/5] usbnet: printk format warning Randy.Dunlap
2006-08-08  0:23         ` patch usbnet-printk-format-warning.patch added to gregkh-2.6 tree gregkh
2006-08-08  3:29         ` Andrew Morton [this message]
2006-08-08  9:01   ` [PATCH -mm 2/5] cachefiles: printk format warning David Howells
2006-08-07 23:07 ` [PATCH -mm 1/5] nbd: " Pavel Machek
2006-08-07 23:31   ` Randy.Dunlap
2006-08-07 23:31     ` Pavel Machek
2006-08-07 23:43       ` Randy.Dunlap

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=20060807202945.48d7e86a.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    /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