* [PATCH] sysfs: fix compile warning in i386
@ 2013-04-03 4:22 Zhang Yanfei
2013-04-03 18:06 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Yanfei @ 2013-04-03 4:22 UTC (permalink / raw)
To: Greg KH; +Cc: kbuild test robot, linux-kernel@vger.kernel.org
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);
return rc;
}
static DEVICE_ATTR(crash_notes_size, 0400, show_crash_notes_size, NULL);
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] sysfs: fix compile warning in i386
2013-04-03 4:22 [PATCH] sysfs: fix compile warning in i386 Zhang Yanfei
@ 2013-04-03 18:06 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2013-04-03 18:06 UTC (permalink / raw)
To: Zhang Yanfei; +Cc: kbuild test robot, linux-kernel@vger.kernel.org
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-03 18:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-03 4:22 [PATCH] sysfs: fix compile warning in i386 Zhang Yanfei
2013-04-03 18:06 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox