path: root/kernel/params.c
diff options
authorChristoph Jaeger <>2013-08-20 15:33:18 +0930
committerRusty Russell <>2013-08-20 15:37:28 +0930
commit79ac6834c255d9e3832209f3738d6bff7b87c743 (patch)
tree8dbd5a12aa780a450f67533e3f4ec75a83ac7bfe /kernel/params.c
parentad81f0545ef01ea651886dddac4bef6cec930092 (diff)
module: fix sprintf format specifier in param_get_byte()
In param_get_byte(), to which the macro STANDARD_PARAM_DEF(byte, ...) expands, "%c" is used to print an unsigned char. So it gets printed as a character what is not intended here. Use "%hhu" instead. [Rusty: note drivers which would be effected: drivers/net/wireless/cw1200/main.c drivers/ntb/ntb_transport.c:68 drivers/scsi/lpfc/lpfc_attr.c drivers/usb/atm/speedtch.c drivers/usb/gadget/g_ffs.c ] Acked-by: Jon Mason <> (for ntb) Acked-by: Michal Nazarewicz <> (for g_ffs.c) Signed-off-by: Christoph Jaeger <> Signed-off-by: Rusty Russell <>
Diffstat (limited to 'kernel/params.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/params.c b/kernel/params.c
index 440e65d1a544..59f7ac7bec04 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -252,7 +252,7 @@ int parse_args(const char *doing,
-STANDARD_PARAM_DEF(byte, unsigned char, "%c", unsigned long, strict_strtoul);
+STANDARD_PARAM_DEF(byte, unsigned char, "%hhu", unsigned long, strict_strtoul);
STANDARD_PARAM_DEF(short, short, "%hi", long, strict_strtol);
STANDARD_PARAM_DEF(ushort, unsigned short, "%hu", unsigned long, strict_strtoul);
STANDARD_PARAM_DEF(int, int, "%i", long, strict_strtol);