Commit 1dd5cc77 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] CLOCK_TICK_RATE: use CLOCK_TICK_RATE

From: Thorsten Kranzkowski <dl8bcu@dl8bcu.de>

use CLOCK_TICK_RATE where 1193180 was used in general timing calculations. 
(optional)
parent 52161621
...@@ -142,7 +142,7 @@ struct analog_port { ...@@ -142,7 +142,7 @@ struct analog_port {
#ifdef __i386__ #ifdef __i386__
#define GET_TIME(x) do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0) #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") #define TIME_NAME (cpu_has_tsc?"TSC":"PIT")
static unsigned int get_time_pit(void) static unsigned int get_time_pit(void)
{ {
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <asm/timex.h>
#include "sound_config.h" #include "sound_config.h"
#include "pas2.h" #include "pas2.h"
...@@ -62,13 +63,13 @@ static int pcm_set_speed(int arg) ...@@ -62,13 +63,13 @@ static int pcm_set_speed(int arg)
if (pcm_channels & 2) if (pcm_channels & 2)
{ {
foo = (596590 + (arg / 2)) / arg; foo = ((CLOCK_TICK_RATE / 2) + (arg / 2)) / arg;
arg = (596590 + (foo / 2)) / foo; arg = ((CLOCK_TICK_RATE / 2) + (foo / 2)) / foo;
} }
else else
{ {
foo = (1193180 + (arg / 2)) / arg; foo = (CLOCK_TICK_RATE + (arg / 2)) / arg;
arg = (1193180 + (foo / 2)) / foo; arg = (CLOCK_TICK_RATE + (foo / 2)) / foo;
} }
pcm_speed = arg; pcm_speed = arg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment