From: "H. Peter Anvin" <hpa@zytor.com>
To: Chris Wedgwood <cw@f00f.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Type cast some size_t arguments to 'unsigned int' to avoid (harmless) gcc printk warnings.
Date: Tue, 08 May 2007 20:41:59 -0700 [thread overview]
Message-ID: <46414307.90504@zytor.com> (raw)
In-Reply-To: <20070508185142.9ED501827261@tuatara.stupidest.org>
Chris Wedgwood wrote:
> Signed-off-by: Chris Wedgwood <cw@f00f.org>
> ---
> net/sunrpc/sched.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
> index 4a53e94..60df3c1 100644
> --- a/net/sunrpc/sched.c
> +++ b/net/sunrpc/sched.c
> @@ -764,7 +764,7 @@ void *rpc_malloc(struct rpc_task *task, size_t size)
> buf = kmalloc(size, gfp);
> *buf = size;
> dprintk("RPC: %5u allocated buffer of size %u at %p\n",
> - task->tk_pid, size, buf);
> + task->tk_pid, (unsigned int)size, buf);
> return (void *) ++buf;
> }
>
> @@ -783,7 +783,7 @@ void rpc_free(void *buffer)
> buf--;
>
> dprintk("RPC: freeing buffer of size %u at %p\n",
> - size, buf);
> + (unsigned int)size, buf);
> if (size <= RPC_BUFFER_MAXSIZE)
> mempool_free(buf, rpc_buffer_mempool);
> else
NAK. This is wrong for multiple reasons.
Use %zu instead.
-hpa
prev parent reply other threads:[~2007-05-09 3:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-08 18:29 [PATCH] Type cast some size_t arguments to 'unsigned int' to avoid (harmless) gcc printk warnings Chris Wedgwood
2007-05-08 20:03 ` Alexey Dobriyan
2007-05-08 20:06 ` Chris Wedgwood
2007-05-09 3:41 ` H. Peter Anvin [this message]
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=46414307.90504@zytor.com \
--to=hpa@zytor.com \
--cc=cw@f00f.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox