Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755584Ab3HFVNb (ORCPT ); Tue, 6 Aug 2013 17:13:31 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:41372 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752213Ab3HFVN3 (ORCPT ); Tue, 6 Aug 2013 17:13:29 -0400 X-Sasl-enc: dIjryLR0gAPllMNbNdth7VeLT1Fu2HOvD8nsWE369Ewt 1375823606 From: Christoph Jaeger To: Rusty Russell Cc: linux-kernel@vger.kernel.org, Christoph Jaeger Subject: [PATCH 1/1] module: fix sprintf format specifier in param_get_byte() Date: Tue, 6 Aug 2013 23:12:12 +0200 Message-Id: <1375823532-24153-1-git-send-email-christophjaeger@linux.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1172 Lines: 30 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. Signed-off-by: Christoph Jaeger --- kernel/params.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/params.c b/kernel/params.c index 440e65d..59f7ac7 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -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); -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/