linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Baolin Wang <baolin.wang@linaro.org>
Cc: a.zummo@towertech.it, rostedt@goodmis.org, mingo@redhat.com,
	john.stultz@linaro.org, tglx@linutronix.de, broonie@kernel.org,
	linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com
Subject: Re: [PATCH] rtc: Add some dummy static inline functions
Date: Wed, 7 Sep 2016 14:12:34 +0200	[thread overview]
Message-ID: <20160907121234.wrmxikrkrnw6lm7z@piout.net> (raw)
In-Reply-To: <08716c8296f91fc43a64fbd0a4145b451a02f161.1473232117.git.baolin.wang@linaro.org>

On 07/09/2016 at 15:17:26 +0800, Baolin Wang wrote :
> Add some dummy static inline functions in case CONFIG_RTC_LIB is not defined.
> 

The question your commit log should answer is why?

> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
> Fixes: a0a6e06d545a ("time: alarmtimer: Add tracepoints for alarmtimers")
> ---
>  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
> 

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2016-09-07 12:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  7:17 [PATCH] rtc: Add some dummy static inline functions Baolin Wang
2016-09-07 12:12 ` Alexandre Belloni [this message]
2016-09-07 12:47   ` Baolin Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160907121234.wrmxikrkrnw6lm7z@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=a.zummo@towertech.it \
    --cc=baolin.wang@linaro.org \
    --cc=broonie@kernel.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).