From: tip-bot for Nicolas Pitre <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, hpa@zytor.com, nico@linaro.org,
josh@joshtriplett.org, ecree@solarflare.com, pebolle@tiscali.nl,
linux-kernel@vger.kernel.org, richardcochran@gmail.com,
john.stultz@linaro.org, mmarek@suse.com,
nicolas.pitre@linaro.org, mingo@kernel.org
Subject: [tip:timers/core] timer: Move sys_alarm from timer.c to itimer.c
Date: Wed, 16 Nov 2016 00:32:35 -0800 [thread overview]
Message-ID: <tip-74ba181e61c6accf9066d6980f44588de2f854f6@git.kernel.org> (raw)
In-Reply-To: <1478841010-28605-5-git-send-email-nicolas.pitre@linaro.org>
Commit-ID: 74ba181e61c6accf9066d6980f44588de2f854f6
Gitweb: http://git.kernel.org/tip/74ba181e61c6accf9066d6980f44588de2f854f6
Author: Nicolas Pitre <nicolas.pitre@linaro.org>
AuthorDate: Fri, 11 Nov 2016 00:10:08 -0500
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 16 Nov 2016 09:26:34 +0100
timer: Move sys_alarm from timer.c to itimer.c
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 <nico@linaro.org>
Acked-by: John Stultz <john.stultz@linaro.org>
Cc: Paul Bolle <pebolle@tiscali.nl>
Cc: linux-kbuild@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Michal Marek <mmarek@suse.com>
Cc: Edward Cree <ecree@solarflare.com>
Link: http://lkml.kernel.org/r/1478841010-28605-5-git-send-email-nicolas.pitre@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
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 4cea09d..23f0f5c 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 1d5c720..2b9f45b 100644
--- a/kernel/time/itimer.c
+++ b/kernel/time/itimer.c
@@ -238,6 +238,8 @@ again:
return 0;
}
+#ifdef __ARCH_WANT_SYS_ALARM
+
/**
* alarm_setitimer - set alarm in seconds
*
@@ -250,7 +252,7 @@ again:
* 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 88aab86..42d27aa 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);
next prev parent reply other threads:[~2016-11-16 8:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-11 5:10 [PATCH v4 0/6] make POSIX timers optional with some Kconfig help Nicolas Pitre
2016-11-11 5:10 ` [PATCH v4 1/6] kconfig: introduce the "imply" keyword Nicolas Pitre
2016-11-16 8:30 ` [tip:timers/core] Kconfig: Introduce " tip-bot for Nicolas Pitre
2016-11-11 5:10 ` [PATCH v4 2/6] kconfig: regenerate *.c_shipped files after previous changes Nicolas Pitre
2016-11-16 8:31 ` [tip:timers/core] Kconfig: Regenerate " tip-bot for Nicolas Pitre
2016-11-11 5:10 ` [PATCH v4 3/6] ptp_clock: allow for it to be optional Nicolas Pitre
2016-11-16 8:32 ` [tip:timers/core] ptp_clock: Allow " tip-bot for Nicolas Pitre
2016-11-17 16:44 ` Arnd Bergmann
2016-11-18 0:48 ` Nicolas Pitre
2016-11-18 9:15 ` Arnd Bergmann
2016-11-11 5:10 ` [PATCH v4 4/6] timer: move sys_alarm from timer.c to itimer.c Nicolas Pitre
2016-11-16 8:32 ` tip-bot for Nicolas Pitre [this message]
2016-11-11 5:10 ` [PATCH v4 5/6] posix_cpu_timers_exit: wrong place to collect entropy Nicolas Pitre
2016-11-16 8:33 ` [tip:timers/core] posix_cpu_timers: Move the add_device_randomness() call to a proper place tip-bot for Nicolas Pitre
2016-11-11 5:10 ` [PATCH v4 6/6] posix-timers: make it configurable Nicolas Pitre
2016-11-16 0:48 ` John Stultz
2016-11-16 8:33 ` [tip:timers/core] posix-timers: Make them configurable tip-bot for Nicolas Pitre
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=tip-74ba181e61c6accf9066d6980f44588de2f854f6@git.kernel.org \
--to=tipbot@zytor.com \
--cc=ecree@solarflare.com \
--cc=hpa@zytor.com \
--cc=john.stultz@linaro.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mmarek@suse.com \
--cc=nico@linaro.org \
--cc=nicolas.pitre@linaro.org \
--cc=pebolle@tiscali.nl \
--cc=richardcochran@gmail.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).