]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
clocksource/drivers/arm_arch_timer: Fix mem frame loop initialization
authorMatthias Kaehlcke <mka@chromium.org>
Wed, 30 Aug 2017 17:41:00 +0000 (19:41 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 15 Sep 2017 12:33:56 +0000 (14:33 +0200)
commit582945ec835e4fafbf57c87750c2e28f9c954714
treea213c81e7a6fd0298c5b017391ca15238e49a2be
parent22fb6a0d5025fb69f5e5644a8536e042f3f274ba
clocksource/drivers/arm_arch_timer: Fix mem frame loop initialization

BugLink: https://bugs.launchpad.net/bugs/1713821
The loop to find the best memory frame in arch_timer_mem_acpi_init()
initializes the loop counter with itself ('i = i'), which is suspicious
in the first place and pointed out by clang. The loop condition is
'i < timer_count' and a prior for loop exits when 'i' reaches
'timer_count', therefore the second loop is never executed.

Initialize the loop counter with 0 to iterate over all timers, which
supposedly was the intention before the typo monster attacked.

Fixes: c2743a36765d3 ("clocksource: arm_arch_timer: add GTDT support for memory-mapped timer")
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
(cherry picked from commit d197f7988721221fac64f899efd7657c15281810)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Colin King <colin.king@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/clocksource/arm_arch_timer.c