1
0
Fork 0

ARM: pxa: Wunused-result warning in viper board file

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>
hifive-unleashed-5.1
Arnd Bergmann 2012-04-30 16:53:11 +00:00
parent 9c7f4f5ce6
commit 5f0cc6d16c
1 changed files with 1 additions and 2 deletions

View 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);