lkml.org 
[lkml]   [2012]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 03/17] ARM: pxa: Wunused-result warning in viper board file
Date
From
On Tue,  2 Oct 2012 18:36:42 +0200, Arnd Bergmann <arnd@arndb.de> wrote:
> 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>
> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
> Cc: Eric Miao <eric.y.miao@gmail.com>
> Cc: Marc Zyngier <maz@misterjones.org>

Acked-by: Marc Zyngier <maz@misterjones.org>

> ---
> arch/arm/mach-pxa/viper.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
> index 130379f..ac733e9 100644
> --- a/arch/arm/mach-pxa/viper.c
> +++ b/arch/arm/mach-pxa/viper.c
> @@ -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);

--
Who you jivin' with that Cosmik Debris?


\
 
 \ /
  Last update: 2012-10-02 20:01    [W:0.026 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site