sysfs: fix compile warning in i386
PATCH 1/1 sysfs: fix compile warning in i386
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 <[email protected]>
Signed-off-by Zhang Yanfei <[email protected]>
--- drivers/base/cpu.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/base/cpu.c +3 -1
@@ -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);
Signature · 1 line
1.7.1
Greg KH
maintainerQuoted 16 lines · Zhang Yanfei
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 <[email protected]>Signed-off-by Zhang Yanfei <[email protected]>--- drivers/base/cpu.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)drivers/base/cpu.c +0
-0
drivers/base/cpu.c static ssize_t show_crash_notes_size(struct device *dev, · line 144
Quoted 8 lines
drivers/base/cpu.c +3
-1@@ -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