timekeeping: Add persistent_clock_exist flag
authorFeng Tang <feng.tang@intel.com>
Tue, 15 Jan 2013 16:09:47 +0000 (00:09 +0800)
committerJohn Stultz <john.stultz@linaro.org>
Wed, 16 Jan 2013 02:16:07 +0000 (18:16 -0800)
commit31ade30692dc9680bfc95700d794818fa3f754ac
treecb436c839b890d04f589b49f75cb0df59315158e
parentf0dbe81f0e7c39783ad25d9084bbcda131508993
timekeeping: Add persistent_clock_exist flag

In current kernel, there are several places which need to check
whether there is a persistent clock for the platform. Current check
is done by calling the read_persistent_clock() and validating its
return value.

So one optimization is to do the check only once in timekeeping_init(),
and use a flag persistent_clock_exist to record it.

v2: Add a has_persistent_clock() helper function, as suggested by John.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
include/linux/time.h
kernel/time/timekeeping.c