public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: kbuild test robot <fengguang.wu@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sysfs: fix compile warning in i386
Date: Wed, 3 Apr 2013 11:06:56 -0700	[thread overview]
Message-ID: <20130403180656.GA7407@kroah.com> (raw)
In-Reply-To: <515BAE6E.4040502@cn.fujitsu.com>

On Wed, Apr 03, 2013 at 12:22:06PM +0800, Zhang Yanfei wrote:
> This patch fixes compile warning in i386:
> 
> drivers/base/cpu.c: In function 'show_crash_notes_size':
> drivers/base/cpu.c:142:2: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat]
> 
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> ---
>  drivers/base/cpu.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> index a55b590..ee38cc2 100644
> --- a/drivers/base/cpu.c
> +++ b/drivers/base/cpu.c
> @@ -138,8 +138,10 @@ static ssize_t show_crash_notes_size(struct device *dev,
>  				     char *buf)
>  {
>  	ssize_t rc;
> +	unsigned long size;
>  
> -	rc = sprintf(buf, "%lu\n", sizeof(note_buf_t));
> +	size = sizeof(note_buf_t);
> +	rc = sprintf(buf, "%lu\n", size);

No, use %z, like Arnd did in his patch, that makes it correct for all
arches.  I'll take his patch instead.

thanks,

greg k-h

      reply	other threads:[~2013-04-03 18:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-03  4:22 [PATCH] sysfs: fix compile warning in i386 Zhang Yanfei
2013-04-03 18:06 ` Greg KH [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=20130403180656.GA7407@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhangyanfei@cn.fujitsu.com \
    /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