All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH] input/joydev: Remove custom msecs_to_jiffies() macro
@ 2005-03-24 14:24 Tobias Klauser
  2005-03-24 15:47 ` Nishanth Aravamudan
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Klauser @ 2005-03-24 14:24 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

Replace the MSECS() macro with the msecs_to_jiffies() function provided
in jiffies.h. The current macro is incorrect because HZ can have
different values on different architectures.

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>

diff -urpN linux-2.6.11.orig/drivers/input/joydev.c linux-2.6.11/drivers/input/joydev.c
--- linux-2.6.11.orig/drivers/input/joydev.c	2005-03-02 12:50:39.000000000 +0100
+++ linux-2.6.11/drivers/input/joydev.c	2005-03-23 16:36:14.000000000 +0100
@@ -37,8 +37,6 @@ MODULE_LICENSE("GPL");
 #define JOYDEV_MINORS		16
 #define JOYDEV_BUFFER_SIZE	64
 
-#define MSECS(t)	(1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ)
-
 struct joydev {
 	int exist;
 	int open;
@@ -117,7 +115,7 @@ static void joydev_event(struct input_ha
 			return;
 	}
 
-	event.time = MSECS(jiffies);
+	event.time = msecs_to_jiffies(jiffies);
 
 	list_for_each_entry(list, &joydev->list, node) {
 
@@ -245,7 +243,7 @@ static ssize_t joydev_read(struct file *
 
 		struct js_event event;
 
-		event.time = MSECS(jiffies);
+		event.time = msecs_to_jiffies(jiffies);
 
 		if (list->startup < joydev->nkey) {
 			event.type = JS_EVENT_BUTTON | JS_EVENT_INIT;

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] [PATCH] input/joydev: Remove custom msecs_to_jiffies() macro
  2005-03-24 14:24 [KJ] [PATCH] input/joydev: Remove custom msecs_to_jiffies() macro Tobias Klauser
@ 2005-03-24 15:47 ` Nishanth Aravamudan
  0 siblings, 0 replies; 2+ messages in thread
From: Nishanth Aravamudan @ 2005-03-24 15:47 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 325 bytes --]

On Thu, Mar 24, 2005 at 03:24:22PM +0100, Tobias Klauser wrote:
> Replace the MSECS() macro with the msecs_to_jiffies() function provided
> in jiffies.h. The current macro is incorrect because HZ can have
> different values on different architectures.

You want jiffies_to_msecs() here, not msecs_to_jiffies().

Thanks,
Nish

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2005-03-24 15:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-24 14:24 [KJ] [PATCH] input/joydev: Remove custom msecs_to_jiffies() macro Tobias Klauser
2005-03-24 15:47 ` Nishanth Aravamudan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.