lkml.org 
[lkml]   [2004]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] sort out CLOCK_TICK_RATE usage, 2nd try [3/3]

General comment: diffstat -p1 patch_file
would be a good addition.


On Tue, 13 Apr 2004 22:02:30 +0000 Thorsten Kranzkowski wrote:

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

* Add spaces around operators please. It's much more readable
that way.

| 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
| @@ -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;

* Add spaces around operators, as: ((CLOCK_TICK_RATE / 2)


And finally, does this change support (or allow) CLOCK_TICK_RATE
to be a variable instead of a #define?

as in include/asm-i386/mach-pc9800/setup_arch_pre.h:
int CLOCK_TICK_RATE;

and include/asm-i386/timex.h:
#ifdef CONFIG_X86_PC9800
extern int CLOCK_TICK_RATE;

More likely (IMO), X86_PC9800 sub-arch will have to be changed
(if it ever works).

--
~Randy
-
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/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.063 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site