lkml.org 
[lkml]   [2016]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 26/28] nios2: fix timer initcall return value
On Tue, Oct 18, 2016 at 6:16 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> When called more than twice, the nios2_time_init() function
> return an uninitialized value, as detected by gcc -Wmaybe-uninitialized
>
> arch/nios2/kernel/time.c: warning: 'ret' may be used uninitialized in this function
>
> This makes it return '0' here, matching the comment above the
> function.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/nios2/kernel/time.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/nios2/kernel/time.c b/arch/nios2/kernel/time.c
> index d9563dd..746bf5c 100644
> --- a/arch/nios2/kernel/time.c
> +++ b/arch/nios2/kernel/time.c
> @@ -324,6 +324,7 @@ static int __init nios2_time_init(struct device_node *timer)
> ret = nios2_clocksource_init(timer);
> break;
> default:
> + ret = 0;
> break;
> }
Acked-by: Ley Foon Tan <lftan@altera.com>

\
 
 \ /
  Last update: 2016-10-24 02:55    [W:1.069 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site