lkml.org 
[lkml]   [2013]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] sysfs: fix crash_notes_size build warning
On Wed, Apr 03, 2013 at 03:18:24PM +0000, Arnd Bergmann wrote:
> From b60d17603df3225d9f51c4f8168e8e00a1090911 Mon Sep 17 00:00:00 2001
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Wed, 3 Apr 2013 17:14:32 +0200
> Subject: [PATCH] sysfs: fix crash_notes_size build warning
>
> commit eca4549f57 "sysfs: Add crash_notes_size to export percpu
> note size" adds a printk that outputs a size_t value as %lu
> when it should be %zu, resulting in this warning.
>
> 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=]
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
> Cc: Simon Horman <horms@verge.net.au>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Sorry for letting that slip through.

Acked-by: Simon Horman <horms@verge.net.au>

>
> diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
> index a55b590..d8c7f3e 100644
> --- a/drivers/base/cpu.c
> +++ b/drivers/base/cpu.c
> @@ -139,7 +139,7 @@ static ssize_t show_crash_notes_size(struct device *dev,
> {
> ssize_t rc;
>
> - rc = sprintf(buf, "%lu\n", sizeof(note_buf_t));
> + rc = sprintf(buf, "%zu\n", sizeof(note_buf_t));
> return rc;
> }
> static DEVICE_ATTR(crash_notes_size, 0400, show_crash_notes_size, NULL);
>


\
 
 \ /
  Last update: 2013-04-04 02:41    [W:0.032 / U:0.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site