linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 07/25] posix-timers:Change the implementation for timer_gettime syscall function
@ 2015-06-01 11:55 Baolin Wang
  2015-06-02 19:20 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Baolin Wang @ 2015-06-01 11:55 UTC (permalink / raw)
  To: tglx; +Cc: arnd, linux-kernel, baolin.wang, y2038

This patch splits out the guts of the timer_gettime syscall and changes the
timer_gettime syscall implementation to prepare the converting to 64bit methods
for the timer_gettime syscall function in posix-timers.c file.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 kernel/time/posix-timers.c |   16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 96efe1d..d00f8ed 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -795,11 +795,8 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)
 		cur_setting->it_value = ktime_to_timespec(remaining);
 }
 
-/* Get the time remaining on a POSIX.1b interval timer. */
-SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id,
-		struct itimerspec __user *, setting)
+static int __timer_gettime(timer_t timer_id, struct itimerspec *cur_setting)
 {
-	struct itimerspec cur_setting;
 	struct k_itimer *timr;
 	struct k_clock *kc;
 	unsigned long flags;
@@ -813,9 +810,18 @@ SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id,
 	if (WARN_ON_ONCE(!kc || !kc->timer_get))
 		ret = -EINVAL;
 	else
-		kc->timer_get(timr, &cur_setting);
+		kc->timer_get(timr, cur_setting);
 
 	unlock_timer(timr, flags);
+	return ret;
+}
+
+/* Get the time remaining on a POSIX.1b interval timer. */
+SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id,
+		struct itimerspec __user *, setting)
+{
+	struct itimerspec cur_setting;
+	int ret = __timer_gettime(timer_id, &cur_setting);
 
 	if (!ret && copy_to_user(setting, &cur_setting, sizeof (cur_setting)))
 		return -EFAULT;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v4 07/25] posix-timers:Change the implementation for timer_gettime syscall function
  2015-06-01 11:55 [PATCH v4 07/25] posix-timers:Change the implementation for timer_gettime syscall function Baolin Wang
@ 2015-06-02 19:20 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2015-06-02 19:20 UTC (permalink / raw)
  To: Baolin Wang; +Cc: arnd, linux-kernel, y2038

On Mon, 1 Jun 2015, Baolin Wang wrote:

That's a new variant of useless subject lines. Sigh.

> This patch splits out the guts of the timer_gettime syscall and changes the
> timer_gettime syscall implementation to prepare the converting to 64bit methods
> for the timer_gettime syscall function in posix-timers.c file.

Your supply of useless information like the file name of the file
which is changed by the patch seems to be endless.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-02 19:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-01 11:55 [PATCH v4 07/25] posix-timers:Change the implementation for timer_gettime syscall function Baolin Wang
2015-06-02 19:20 ` Thomas Gleixner

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).