Commit 79ac6834 authored by Christoph Jaeger's avatar Christoph Jaeger Committed by Rusty Russell

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 <jon.mason@intel.com> (for ntb)
Acked-by: Michal Nazarewicz <mina86@mina86.com> (for g_ffs.c)
Signed-off-by: default avatarChristoph Jaeger <christophjaeger@linux.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent ad81f054
......@@ -252,7 +252,7 @@ int parse_args(const char *doing,
EXPORT_SYMBOL(param_ops_##name)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment