]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ARM: pxa: Wunused-result warning in viper board file
authorArnd Bergmann <arnd@arndb.de>
Mon, 30 Apr 2012 16:53:11 +0000 (16:53 +0000)
committerArnd Bergmann <arnd@arndb.de>
Thu, 4 Oct 2012 08:19:51 +0000 (10:19 +0200)
Calling kstrtoul requires checking the result. In case of
the viper_tpm_setup function, let's fail the __setup function
if the number was invalid.

Without this patch, building viper_defconfig results in:

arch/arm/mach-pxa/viper.c: In function 'viper_tpm_setup':
arch/arm/mach-pxa/viper.c:771:10: warning: ignoring return value of 'kstrtoul', declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Marc Zyngier <maz@misterjones.org>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
arch/arm/mach-pxa/viper.c

index 130379fb9d0fbbd405c0df4a36aee790ea1244ec..ac733e91f3e4b1ccea393432eb18d7a5bd21144e 100644 (file)
@@ -768,8 +768,7 @@ static unsigned long viper_tpm;
 
 static int __init viper_tpm_setup(char *str)
 {
-       strict_strtoul(str, 10, &viper_tpm);
-       return 1;
+       return strict_strtoul(str, 10, &viper_tpm) >= 0;
 }
 
 __setup("tpm=", viper_tpm_setup);