clocksource/drivers/kona: Fix get_counter() error handling
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 <firstname.lastname@example.org>
Signed-off-by: Daniel Lezcano <email@example.com>
Acked-by: Ray Jui <firstname.lastname@example.org>
Cc: Linus Torvalds <email@example.com>
Cc: Peter Zijlstra <firstname.lastname@example.org>
Cc: Thomas Gleixner <email@example.com>
Signed-off-by: Ingo Molnar <firstname.lastname@example.org>
1 file changed