lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 19 Aug 2008 11:43:32 +0200 (CEST)
From:	Geert Uytterhoeven <Geert.Uytterhoeven@...ycom.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>
cc:	linux-input@...r.kernel.org,
	Linux Kernel Development <linux-kernel@...r.kernel.org>
Subject: [PATCH] drivers/input/evdev.c: Fix printf() format for sizeof

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@...ycom.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@...ycom.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ