diff mbox

[v4,1/4] time: Add needed macros for timekeeping_inject_sleeptime64()

Message ID 1424005785-17865-1-git-send-email-xlpang@126.com
State New
Headers show

Commit Message

Xunlei Pang Feb. 15, 2015, 1:09 p.m. UTC
From: Xunlei Pang <pang.xunlei@linaro.org>

timekeeping_inject_sleeptime64() is only used by RTC suspend/resume,
so embrace it in RTC related macros.

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
---
 kernel/time/timekeeping.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

John Stultz Feb. 26, 2015, 5:08 a.m. UTC | #1
On Sun, Feb 15, 2015 at 5:09 AM, Xunlei Pang <xlpang@126.com> wrote:
> From: Xunlei Pang <pang.xunlei@linaro.org>
>
> timekeeping_inject_sleeptime64() is only used by RTC suspend/resume,
> so embrace it in RTC related macros.
>
> Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
> ---
>  kernel/time/timekeeping.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
> index b124af2..d78a528 100644
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -1125,6 +1125,9 @@ static void __timekeeping_inject_sleeptime(struct timekeeper *tk,
>         tk_debug_account_sleep_time(delta);
>  }
>
> +#if defined(CONFIG_RTC_CLASS) && \
> +       defined(CONFIG_PM_SLEEP) && \
> +       defined(CONFIG_RTC_HCTOSYS_DEVICE)

So RTC_HCTOSYS_DEVICE implies RTC_CLASS, so that could be simplified a bit...

thanks
-john
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

Patch

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index b124af2..d78a528 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1125,6 +1125,9 @@  static void __timekeeping_inject_sleeptime(struct timekeeper *tk,
 	tk_debug_account_sleep_time(delta);
 }
 
+#if defined(CONFIG_RTC_CLASS) && \
+	defined(CONFIG_PM_SLEEP) && \
+	defined(CONFIG_RTC_HCTOSYS_DEVICE)
 /**
  * timekeeping_inject_sleeptime64 - Adds suspend interval to timeekeeping values
  * @delta: pointer to a timespec64 delta value
@@ -1162,6 +1165,7 @@  void timekeeping_inject_sleeptime64(struct timespec64 *delta)
 	/* signal hrtimers about time change */
 	clock_was_set();
 }
+#endif
 
 /**
  * timekeeping_resume - Resumes the generic timekeeping subsystem.