From patchwork Fri Nov 11 05:10:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 693569 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3tFSg329dsz9t10 for ; Fri, 11 Nov 2016 16:10:55 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932636AbcKKFKe (ORCPT ); Fri, 11 Nov 2016 00:10:34 -0500 Received: from alt13.smtp-out.videotron.ca ([135.19.0.26]:34257 "EHLO alt12.smtp-out.videotron.ca" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750849AbcKKFKb (ORCPT ); Fri, 11 Nov 2016 00:10:31 -0500 Received: from yoda.home ([96.23.157.65]) by Videotron with SMTP id 546dcRDkoq3HF546gcINvc; Fri, 11 Nov 2016 00:10:30 -0500 X-Authority-Analysis: v=2.1 cv=Q9lym9Ca c=1 sm=1 tr=0 a=keA3yYpnlypCNW5BNWqu+w==:117 a=keA3yYpnlypCNW5BNWqu+w==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=L24OOQBejmoA:10 a=KKAkSRfTAAAA:8 a=KhTQip-t4STU-54Kx7oA:9 a=cvBusfyB2V15izCimMoJ:22 Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 6F6B62DA0622; Fri, 11 Nov 2016 00:10:27 -0500 (EST) From: Nicolas Pitre To: John Stultz , Michal Marek Cc: Richard Cochran , Paul Bolle , Thomas Gleixner , Josh Triplett , Edward Cree , netdev@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/6] timer: move sys_alarm from timer.c to itimer.c Date: Fri, 11 Nov 2016 00:10:08 -0500 Message-Id: <1478841010-28605-5-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478841010-28605-1-git-send-email-nicolas.pitre@linaro.org> References: <1478841010-28605-1-git-send-email-nicolas.pitre@linaro.org> X-CMAE-Envelope: MS4wfBpEPD1WD+DRnMVI//xKX6ep0caU3NZjjKJJSNceitOub2gfeXFajsAWip4KO0dKeTckt3PheKj2qOUoPkTljVF9FBxhkRYLKLTQJgDKF+MUr5macKsj ibSHJBmlYcRTDcOMMTYpCI5d8Cws2q4HNUWbrxA6yBdNX48hqG7M7Cw6Ft7/CYMbPuzWPoj5ix7E/YNAEQKbUlhBAe7cLmoZn1zjFhuqYN2oWIC8/+gJc9/+ dFmyOkz2gID9xSXT1r/FJoyYl3+9Moghes65c71kmK4Up5ZLQjWzaolkSUqq4NBsIL4+bBeUbgs/VmaeiwWzpLOzWAoek4SErAmEx1VY9JMaRNsxKFm2E1V4 fqODqsm7d6+iGzjy1f4sLNreJu43P92+2RFI6GV6LXdpOpwabCKUYvhLFarmUryk3jr/8Y9ZjdRceBuTPHkiYR0l/wWzvD9TsjGVEecXDJ04IonLywO+7wqg fZgqIeb2IGS9puhr Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Move the only user of alarm_setitimer to itimer.c where it is defined. This allows for making alarm_setitimer static, and dropping it from the build when __ARCH_WANT_SYS_ALARM is not defined. Signed-off-by: Nicolas Pitre --- include/linux/time.h | 2 -- kernel/time/itimer.c | 15 ++++++++++++++- kernel/time/timer.c | 13 ------------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/include/linux/time.h b/include/linux/time.h index 4cea09d942..23f0f5ce30 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -172,8 +172,6 @@ extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); extern int do_getitimer(int which, struct itimerval *value); -extern unsigned int alarm_setitimer(unsigned int seconds); - extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags); struct tms; diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c index 1d5c7204dd..2b9f45bc95 100644 --- a/kernel/time/itimer.c +++ b/kernel/time/itimer.c @@ -238,6 +238,8 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue) return 0; } +#ifdef __ARCH_WANT_SYS_ALARM + /** * alarm_setitimer - set alarm in seconds * @@ -250,7 +252,7 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue) * On 32 bit machines the seconds value is limited to (INT_MAX/2) to avoid * negative timeval settings which would cause immediate expiry. */ -unsigned int alarm_setitimer(unsigned int seconds) +static unsigned int alarm_setitimer(unsigned int seconds) { struct itimerval it_new, it_old; @@ -275,6 +277,17 @@ unsigned int alarm_setitimer(unsigned int seconds) return it_old.it_value.tv_sec; } +/* + * For backwards compatibility? This can be done in libc so Alpha + * and all newer ports shouldn't need it. + */ +SYSCALL_DEFINE1(alarm, unsigned int, seconds) +{ + return alarm_setitimer(seconds); +} + +#endif + SYSCALL_DEFINE3(setitimer, int, which, struct itimerval __user *, value, struct itimerval __user *, ovalue) { diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 2d47980a1b..3ed6c67e17 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1662,19 +1662,6 @@ void run_local_timers(void) raise_softirq(TIMER_SOFTIRQ); } -#ifdef __ARCH_WANT_SYS_ALARM - -/* - * For backwards compatibility? This can be done in libc so Alpha - * and all newer ports shouldn't need it. - */ -SYSCALL_DEFINE1(alarm, unsigned int, seconds) -{ - return alarm_setitimer(seconds); -} - -#endif - static void process_timeout(unsigned long __data) { wake_up_process((struct task_struct *)__data);