Skip to contentSkip to conversation

Remove CLOCK_TICK_RATE from analog joystick driver

PATCH Applied Deepak Saxena 2 participants 2 messages Aug 4, 2011 – Aug 5, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove CLOCK_TICK_RATE from analog joystick driver

The analog joystick driver is written for x86 systems. This patch updates it to use the the PIT_TICK_RATE value instead of CLOCK_TICK_RATE as they are equivalent on x86 and we want to depecrate the later.

---
 drivers/input/joystick/analog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/input/joystick/analog.c +1 -1
index 9882971..358cd7e 100644
@@ -139,7 +139,7 @@ struct analog_port {
 #include <linux/i8253.h>
 
 #define GET_TIME(x)	do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0)
-#define DELTA(x,y)	(cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0)))
+#define DELTA(x,y)	(cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? PIT_TICK_RATE / HZ : 0)))
 #define TIME_NAME	(cpu_has_tsc?"TSC":"PIT")
 static unsigned int get_time_pit(void)
 {
Signature · 1 line
1.7.4.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Deepak Saxena

The analog joystick driver is written for x86 systems. This patch updates it to use the the PIT_TICK_RATE value instead of CLOCK_TICK_RATE as they are equivalent on x86 and we want to depecrate the later.

Applied, thank you Deepak.

Quoted 20 lines
---
 drivers/input/joystick/analog.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/input/joystick/analog.c +1 -1
index 9882971..358cd7e 100644
@@ -139,7 +139,7 @@ struct analog_port {
 #include <linux/i8253.h>
 
 #define GET_TIME(x)	do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0)
-#define DELTA(x,y)	(cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? CLOCK_TICK_RATE / HZ : 0)))
+#define DELTA(x,y)	(cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? PIT_TICK_RATE / HZ : 0)))
 #define TIME_NAME	(cpu_has_tsc?"TSC":"PIT")
 static unsigned int get_time_pit(void)
 {
Signature · 1 line
1.7.4.1
Signature · 1 line
Dmitry