Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1485693

[PATCH 1/2] rtc: Add some dummy static inline functions

From Baolin Wang <baolin.wang@linaro.org>
Newsgroups linux.kernel
Subject [PATCH 1/2] rtc: Add some dummy static inline functions
Date 2016-09-18 08:10 +0200
Message-ID <siDsB-4oB-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


The patch 2 in this patchset adding tracepoints for alarmtimers will build
failed on S390 platform, due to S390 defconfig did not define CONFIG_RTC_LIB
macro to define the rtc_ktime_to_tm() function which is used in this patch.
Thus we should add some ummy static inline functions in case CONFIG_RTC_LIB
is not defined.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 include/linux/rtc.h |   49 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index b693ada..521f752 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -16,13 +16,60 @@
 #include <linux/interrupt.h>
 #include <uapi/linux/rtc.h>
 
+#ifdef CONFIG_RTC_LIB
 extern int rtc_month_days(unsigned int month, unsigned int year);
-extern int rtc_year_days(unsigned int day, unsigned int month, unsigned int year);
+extern int rtc_year_days(unsigned int day, unsigned int month,
+			 unsigned int year);
 extern int rtc_valid_tm(struct rtc_time *tm);
 extern time64_t rtc_tm_to_time64(struct rtc_time *tm);
 extern void rtc_time64_to_tm(time64_t time, struct rtc_time *tm);
 ktime_t rtc_tm_to_ktime(struct rtc_time tm);
 struct rtc_time rtc_ktime_to_tm(ktime_t kt);
+#else
+static inline int rtc_month_days(unsigned int month, unsigned int year)
+{
+	return 0;
+}
+
+static inline int rtc_year_days(unsigned int day, unsigned int month,
+				unsigned int year)
+{
+	return 0;
+}
+
+static inline int rtc_valid_tm(struct rtc_time *tm)
+{
+	return 0;
+}
+
+static inline time64_t rtc_tm_to_time64(struct rtc_time *tm)
+{
+	time64_t ret;
+
+	memset(&ret, 0, sizeof(time64_t));
+	return ret;
+}
+
+static inline void rtc_time64_to_tm(time64_t time, struct rtc_time *tm)
+{
+}
+
+static inline ktime_t rtc_tm_to_ktime(struct rtc_time tm)
+{
+	ktime_t ret;
+
+	memset(&ret, 0, sizeof(ktime_t));
+	return ret;
+}
+
+static inline struct rtc_time rtc_ktime_to_tm(ktime_t kt)
+{
+	struct rtc_time ret;
+
+	memset(&ret, 0, sizeof(struct rtc_time));
+	return ret;
+}
+#endif
 
 /*
  * rtc_tm_sub - Return the difference in seconds.
-- 
1.7.9.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] rtc: Add some dummy static inline functions Baolin Wang <baolin.wang@linaro.org> - 2016-09-18 08:10 +0200
  [PATCH 2/2] time: alarmtimer: Add the trcepoints for alarmtimer Baolin Wang <baolin.wang@linaro.org> - 2016-09-18 08:10 +0200
    Re: [PATCH 2/2] time: alarmtimer: Add the trcepoints for  alarmtimer Thomas Gleixner <tglx@linutronix.de> - 2016-09-21 00:40 +0200
      Re: [PATCH 2/2] time: alarmtimer: Add the trcepoints for alarmtimer Baolin Wang <baolin.wang@linaro.org> - 2016-09-21 05:30 +0200
        Re: [PATCH 2/2] time: alarmtimer: Add the trcepoints for  alarmtimer Thomas Gleixner <tglx@linutronix.de> - 2016-09-21 09:30 +0200
          Re: [PATCH 2/2] time: alarmtimer: Add the trcepoints for alarmtimer Baolin Wang <baolin.wang@linaro.org> - 2016-09-21 13:00 +0200
          Re: [PATCH 2/2] time: alarmtimer: Add the trcepoints for  alarmtimer Thomas Gleixner <tglx@linutronix.de> - 2016-09-21 14:40 +0200
            Re: [PATCH 2/2] time: alarmtimer: Add the trcepoints for alarmtimer Steven Rostedt <rostedt@goodmis.org> - 2016-09-21 15:40 +0200
          Re: [PATCH 2/2] time: alarmtimer: Add the trcepoints for alarmtimer Steven Rostedt <rostedt@goodmis.org> - 2016-09-21 14:40 +0200
  Re: [PATCH 1/2] rtc: Add some dummy static inline functions Thomas Gleixner <tglx@linutronix.de> - 2016-09-20 23:40 +0200
    Re: [PATCH 1/2] rtc: Add some dummy static inline functions Baolin Wang <baolin.wang@linaro.org> - 2016-09-21 04:10 +0200

csiph-web