linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/1] alpha/osf_sys: use helper functions to convert between tv and jiffies
@ 2005-05-13 21:44 domen
  2005-05-14 11:27 ` Alexey Dobriyan
  0 siblings, 1 reply; 2+ messages in thread
From: domen @ 2005-05-13 21:44 UTC (permalink / raw)
  To: rth; +Cc: linux-kernel, Nishanth Aravamudan, domen

[-- Attachment #1: timeval-arch_alpha_kernel_osf_sys --]
[-- Type: text/plain, Size: 1014 bytes --]

From: Nishanth Aravamudan <nacc@us.ibm.com>


Use helper functions to convert between timeval structure and jiffies
rather than custom logic.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>

---
 osf_sys.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

Index: quilt/arch/alpha/kernel/osf_sys.c
===================================================================
--- quilt.orig/arch/alpha/kernel/osf_sys.c
+++ quilt/arch/alpha/kernel/osf_sys.c
@@ -1150,16 +1150,13 @@ osf_usleep_thread(struct timeval32 __use
 	if (get_tv32(&tmp, sleep))
 		goto fault;
 
-	ticks = tmp.tv_usec;
-	ticks = (ticks + (1000000 / HZ) - 1) / (1000000 / HZ);
-	ticks += tmp.tv_sec * HZ;
+	ticks = timeval_to_jiffies(&tmp);
 
 	current->state = TASK_INTERRUPTIBLE;
 	ticks = schedule_timeout(ticks);
 
 	if (remain) {
-		tmp.tv_sec = ticks / HZ;
-		tmp.tv_usec = ticks % HZ;
+		jiffies_to_timeval(ticks, &tmp);
 		if (put_tv32(remain, &tmp))
 			goto fault;
 	}

--

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

* Re: [patch 1/1] alpha/osf_sys: use helper functions to convert between tv and jiffies
  2005-05-13 21:44 [patch 1/1] alpha/osf_sys: use helper functions to convert between tv and jiffies domen
@ 2005-05-14 11:27 ` Alexey Dobriyan
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Dobriyan @ 2005-05-14 11:27 UTC (permalink / raw)
  To: domen; +Cc: rth, linux-kernel, Nishanth Aravamudan

On Saturday 14 May 2005 01:44, domen@coderock.org wrote:
> Use helper functions to convert between timeval structure and jiffies
> rather than custom logic.

> --- quilt.orig/arch/alpha/kernel/osf_sys.c
> +++ quilt/arch/alpha/kernel/osf_sys.c

> -	ticks = tmp.tv_usec;
> -	ticks = (ticks + (1000000 / HZ) - 1) / (1000000 / HZ);
> -	ticks += tmp.tv_sec * HZ;
> +	ticks = timeval_to_jiffies(&tmp);

> -		tmp.tv_sec = ticks / HZ;
> -		tmp.tv_usec = ticks % HZ;
> +		jiffies_to_timeval(ticks, &tmp);

Nitpicking comment: both timeval_to_jiffies and jiffies_to_timeval are
prototyped in include/linux/jiffies.h. However, arch/alpha/kernel/osf_sys.c
doesn't directly #include it. 

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

end of thread, other threads:[~2005-05-14 11:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-13 21:44 [patch 1/1] alpha/osf_sys: use helper functions to convert between tv and jiffies domen
2005-05-14 11:27 ` Alexey Dobriyan

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