input/joydev: Remove custom msecs_to_jiffies() macro
Subsystems (2)
PATCH 1/1 input/joydev: Remove custom msecs_to_jiffies() macro
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.
drivers/input/joydev.c +2 -4
@@ -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_hareturn ; } - 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 ;
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 3 lines · Tobias Klauser
Replace the
MSECS()macro with themsecs_to_jiffies()function provided injiffies.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
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors