Messages in this thread Patch in this message | | | Date | Tue, 13 Apr 2004 22:02:30 +0000 | From | Thorsten Kranzkowski <> | Subject | Re: [PATCH] sort out CLOCK_TICK_RATE usage, 2nd try [3/3] |
| |
3/3 use CLOCK_TICK_RATE where 1193182 constant was used in timing calculations
diff -urN linux-2.6.5-2a/drivers/input/joystick/analog.c linux-2.6.5-3a/drivers/input/joystick/analog.c --- linux-2.6.5-2a/drivers/input/joystick/analog.c Sun Apr 11 14:24:48 2004 +++ linux-2.6.5-3a/drivers/input/joystick/analog.c Tue Apr 13 18:38:03 2004 @@ -142,7 +142,7 @@ #ifdef __i386__ #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)?1193182L/HZ:0))) +#define DELTA(x,y) (cpu_has_tsc?((y)-(x)):((x)-(y)+((x)<(y)?CLOCK_TICK_RATE/HZ:0))) #define TIME_NAME (cpu_has_tsc?"TSC":"PIT") static unsigned int get_time_pit(void) { diff -urN linux-2.6.5-2a/sound/oss/pas2_pcm.c linux-2.6.5-3a/sound/oss/pas2_pcm.c --- linux-2.6.5-2a/sound/oss/pas2_pcm.c Thu Dec 18 02:58:28 2003 +++ linux-2.6.5-3a/sound/oss/pas2_pcm.c Tue Apr 13 18:39:22 2004 @@ -17,6 +17,7 @@ #include <linux/init.h> #include <linux/spinlock.h> +#include <asm/timex.h> #include "sound_config.h" #include "pas2.h" @@ -62,13 +63,13 @@ if (pcm_channels & 2) { - foo = (596590 + (arg / 2)) / arg; - arg = (596590 + (foo / 2)) / foo; + foo = ((CLOCK_TICK_RATE/2) + (arg / 2)) / arg; + arg = ((CLOCK_TICK_RATE/2) + (foo / 2)) / foo; } else { - foo = (1193180 + (arg / 2)) / arg; - arg = (1193180 + (foo / 2)) / foo; + foo = (CLOCK_TICK_RATE + (arg / 2)) / arg; + arg = (CLOCK_TICK_RATE + (foo / 2)) / foo; } pcm_speed = arg; -- | Thorsten Kranzkowski Internet: dl8bcu@dl8bcu.de | | Mobile: ++49 170 1876134 Snail: Kiebitzstr. 14, 49324 Melle, Germany | | Ampr: dl8bcu@db0lj.#rpl.deu.eu, dl8bcu@marvin.dl8bcu.ampr.org [44.130.8.19] | - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |