* [PATCH] drivers/input/evdev.c: Fix printf() format for sizeof
@ 2008-08-19 9:43 Geert Uytterhoeven
2008-08-19 15:37 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2008-08-19 9:43 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton, Dmitry Torokhov
Cc: linux-input, Linux Kernel Development
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1637 bytes --]
commit f2afa7711f8585ffc088ba538b9a510e0d5dca12 ("Input: paper over a bug in
Synaptics X driver") introduced a compiler warning on 64-bit platforms, as
sizeof() returns a size_t, not an (unsigned) int:
| drivers/input/evdev.c: In function 'handle_eviocgbit':
| drivers/input/evdev.c:684: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
Use the proper `z' modifier for size_t, and make the printf() formats for the
sizes unsigned while we're at it.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index a92d815..3524bef 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -677,8 +677,8 @@ static int handle_eviocgbit(struct input_dev *dev, unsigned int cmd, void __user
len = OLD_KEY_MAX;
if (printk_timed_ratelimit(&keymax_warn_time, 10 * 1000))
printk(KERN_WARNING
- "evdev.c(EVIOCGBIT): Suspicious buffer size %d, "
- "limiting output to %d bytes. See "
+ "evdev.c(EVIOCGBIT): Suspicious buffer size %u, "
+ "limiting output to %zu bytes. See "
"http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n",
OLD_KEY_MAX,
BITS_TO_LONGS(OLD_KEY_MAX) * sizeof(long));
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis 293-0376800-10 GEBA-BE-BB
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drivers/input/evdev.c: Fix printf() format for sizeof
2008-08-19 9:43 [PATCH] drivers/input/evdev.c: Fix printf() format for sizeof Geert Uytterhoeven
@ 2008-08-19 15:37 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2008-08-19 15:37 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linus Torvalds, Andrew Morton, linux-input,
Linux Kernel Development
On Tue, Aug 19, 2008 at 11:43:32AM +0200, Geert Uytterhoeven wrote:
> commit f2afa7711f8585ffc088ba538b9a510e0d5dca12 ("Input: paper over a bug in
> Synaptics X driver") introduced a compiler warning on 64-bit platforms, as
> sizeof() returns a size_t, not an (unsigned) int:
>
> | drivers/input/evdev.c: In function 'handle_eviocgbit':
> | drivers/input/evdev.c:684: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
>
> Use the proper `z' modifier for size_t, and make the printf() formats for the
> sizes unsigned while we're at it.
>
Oops... Applied, thank you Geert.
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-08-19 15:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-19 9:43 [PATCH] drivers/input/evdev.c: Fix printf() format for sizeof Geert Uytterhoeven
2008-08-19 15:37 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).