Skip to content

Commit

Permalink
ARM: pxa: Wunused-result warning in viper board file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnd Bergmann committed Oct 4, 2012
1 parent 9c7f4f5 commit 5f0cc6d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/arm/mach-pxa/viper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5f0cc6d

Please sign in to comment.