Skip to content

Commit

Permalink
[PATCH] Adapt drivers/char/vt_ioctl.c to non-x86
Browse files Browse the repository at this point in the history
This code uses the x86 (non-AMD-ELAN) value of CLOCK_TICK_RATE instead of
CLOCK_TICK_RATE itself, which is wrong for other archs.

Signed-off-by: Emmanuel Colbus <emmanuel.colbus@ensimag.imag.fr>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Emmanuel Colbus authored and Linus Torvalds committed Jun 29, 2005
1 parent f01b1b0 commit bcc8ca0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/char/vt_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/fs.h>
#include <linux/console.h>
#include <linux/signal.h>
#include <linux/timex.h>

#include <asm/io.h>
#include <asm/uaccess.h>
Expand Down Expand Up @@ -386,7 +387,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
if (!perm)
return -EPERM;
if (arg)
arg = 1193182 / arg;
arg = CLOCK_TICK_RATE / arg;
kd_mksound(arg, 0);
return 0;

Expand All @@ -403,7 +404,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
ticks = HZ * ((arg >> 16) & 0xffff) / 1000;
count = ticks ? (arg & 0xffff) : 0;
if (count)
count = 1193182 / count;
count = CLOCK_TICK_RATE / count;
kd_mksound(count, ticks);
return 0;
}
Expand Down

0 comments on commit bcc8ca0

Please sign in to comment.