From patchwork Thu Sep 8 02:41:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 75720 Delivered-To: patch@linaro.org Received: by 10.140.106.11 with SMTP id d11csp616007qgf; Wed, 7 Sep 2016 19:42:05 -0700 (PDT) X-Received: by 10.98.134.79 with SMTP id x76mr732297pfd.21.1473302525817; Wed, 07 Sep 2016 19:42:05 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r7si44391088pfa.265.2016.09.07.19.42.05; Wed, 07 Sep 2016 19:42:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753178AbcIHCmC (ORCPT + 27 others); Wed, 7 Sep 2016 22:42:02 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:36014 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbcIHClx (ORCPT ); Wed, 7 Sep 2016 22:41:53 -0400 Received: by mail-pa0-f48.google.com with SMTP id id6so12191193pad.3 for ; Wed, 07 Sep 2016 19:41:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=B7kuym//L9aoAGBIqt7Ifi6RSJEHXPEm8zuzKe9U2hI=; b=BIchNgoQ+zQUTsy9Qey+FJFic4WKWZn8ir7t7+9XzMCaiNkLPWshH4KyXpdUj8eLW/ xAzBLIml4B3CmtmwMK6WHs1+nlVaM1AXv1/JeQniPYsl7vPiqydIKs8071wXguM7ceFi eb5q0qd/L6etwIMTwwbEDFnypgOkbp5hF3TeU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=B7kuym//L9aoAGBIqt7Ifi6RSJEHXPEm8zuzKe9U2hI=; b=CQdZIjVXeyTiB5D3caLbM3BcXyJ/QB7CIAvEuSFuTBiZ1S+yZWHLyx7JGiZ+EGX8/v 50lcQH2Sv6E8EjO8GVLpyrOh0xtG7nRt+IKCBrMpA0NfHhlAU9MLfeZoBZVoI0V2P/jh 3fhAJQyvLapUCMoGZjCcjLDEQF7BnjWr+pj5AN5LmzWaSoFrUA+FLKEnvasV26jS9FJU iBHAXf6kx/t/8wEYrVWsKUTO56CGCDXxHvZoiyVWvHkqBg7Q4uCeUwJ56cHrOBbbeIB4 8/oX1rFHsVxTNg5gELxaIP10B9wumRtPcAK+Eb/X97URZjY8Qwu0mXG8CsFB7hTMrOq3 kMjg== X-Gm-Message-State: AE9vXwNDD+sD1hvy+uZlGuImRobCPYksI5suXM+TmHuY1mUbIqQrmp8gxRbf4lmatPWkJfm8 X-Received: by 10.66.190.200 with SMTP id gs8mr5118176pac.42.1473302512563; Wed, 07 Sep 2016 19:41:52 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by smtp.gmail.com with ESMTPSA id d6sm41360909pfe.37.2016.09.07.19.41.49 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Sep 2016 19:41:52 -0700 (PDT) From: Baolin Wang To: a.zummo@towertech.it, alexandre.belloni@free-electrons.com Cc: rostedt@goodmis.org, mingo@redhat.com, john.stultz@linaro.org, tglx@linutronix.de, baolin.wang@linaro.org, broonie@kernel.org, linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com Subject: [PATCH v2] rtc: Add some dummy static inline functions Date: Thu, 8 Sep 2016 10:41:04 +0800 Message-Id: <1a8cf6da9924b566aef1d00a31414e46e7f7fb71.1473302325.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch (commit id: a0a6e06d545a753740c9d8d5ce2c4fdd3ab1c021) 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 dummy static inline functions in case CONFIG_RTC_LIB is not defined. Signed-off-by: Baolin Wang Fixes: a0a6e06d545a ("time: alarmtimer: Add tracepoints for alarmtimers") --- Changes since v1: - Modify the commit log. --- include/linux/rtc.h | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) -- 1.7.9.5 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 #include +#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.