Commit 2f445e0a authored by Yoshinori Sato's avatar Yoshinori Sato Committed by Daniel Lezcano

clocksource/drivers/h8300: Fix timer not overflow case

Signed-off-by: default avatarYoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent 2a0ff877
......@@ -48,8 +48,10 @@ static unsigned long timer16_get_counter(struct timer16_priv *p)
} while (unlikely((o1 != o2) || (v1 > v2 && v1 < v3)
|| (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)));
v2 |= 0x10000;
return v2;
if (likely(!o1))
return v2;
else
return v2 + 0x10000;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment