Re: [PATCH 6/9] clocksource: kona: fix get_counter error handling
From: Daniel Lezcano
Date: Tue Aug 16 2016 - 09:13:24 EST
On 08/10/2016 11:54 PM, Arnd Bergmann wrote:
> I could not figure out why, but gcc cannot prove that the
> kona_timer_init function always initializes its two outputs,
> and we get a warning for the use of the 'lsw' variable later,
> which is obviously correct.
>
> drivers/clocksource/bcm_kona_timer.c: In function 'kona_timer_init':
> drivers/clocksource/bcm_kona_timer.c:119:13: error: 'lsw' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> Slightly reordering the loop makes the warning disappear, after
> it becomes more obvious to the compiler that the loop is
> always entered on the first iteration.
>
> As pointed out by Ray Jui, there is a related problem in the
> way we deal with the loop running into the limit, as we just
> keep going there with an invalid counter data, so instead we
> now propagate a -ETIMEDOUT result to the caller.
>
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> Link: https://patchwork.kernel.org/patch/9174261/
Hi Arnd,
I applied this patch as a fix.
Thanks !
-- Daniel
--
<http://www.linaro.org/> Linaro.org â Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog