提交 c85e2031 编写于 作者: G Geert Uytterhoeven 提交者: Dmitry Torokhov

Input: evdev - fix printf() format for sizeof

commit f2afa771 ("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: NGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 0cc1fe22
...@@ -677,8 +677,8 @@ static int handle_eviocgbit(struct input_dev *dev, unsigned int cmd, void __user ...@@ -677,8 +677,8 @@ static int handle_eviocgbit(struct input_dev *dev, unsigned int cmd, void __user
len = OLD_KEY_MAX; len = OLD_KEY_MAX;
if (printk_timed_ratelimit(&keymax_warn_time, 10 * 1000)) if (printk_timed_ratelimit(&keymax_warn_time, 10 * 1000))
printk(KERN_WARNING printk(KERN_WARNING
"evdev.c(EVIOCGBIT): Suspicious buffer size %d, " "evdev.c(EVIOCGBIT): Suspicious buffer size %u, "
"limiting output to %d bytes. See " "limiting output to %zu bytes. See "
"http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n", "http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n",
OLD_KEY_MAX, OLD_KEY_MAX,
BITS_TO_LONGS(OLD_KEY_MAX) * sizeof(long)); BITS_TO_LONGS(OLD_KEY_MAX) * sizeof(long));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册