diff options
author | Andy Shevchenko <ext-andriy.shevchenko@nokia.com> | 2010-06-15 18:24:16 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-11 00:47:38 +0400 |
commit | 74c807ce3d1f092fc5138c5a54019553061ecc17 (patch) | |
tree | 497ccebc628cf2f605186e73471de15a97caccf2 /drivers/char | |
parent | 690b781b327a1c986c33fb2c51dd966c38222943 (diff) | |
download | linux-74c807ce3d1f092fc5138c5a54019553061ecc17.tar.xz |
vt: clean up the code - use kernel library
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/vt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 44f03ddd8871..34bfb056d7a6 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -105,6 +105,7 @@ #include <asm/system.h> #include <linux/uaccess.h> #include <linux/kdb.h> +#include <linux/ctype.h> #define MAX_NR_CON_DRIVER 16 @@ -1796,8 +1797,8 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, int c) vc->vc_state = ESnormal; return; case ESpalette: - if ( (c>='0'&&c<='9') || (c>='A'&&c<='F') || (c>='a'&&c<='f') ) { - vc->vc_par[vc->vc_npar++] = (c > '9' ? (c & 0xDF) - 'A' + 10 : c - '0'); + if (isxdigit(c)) { + vc->vc_par[vc->vc_npar++] = hex_to_bin(c); if (vc->vc_npar == 7) { int i = vc->vc_par[0] * 3, j = 1; vc->vc_palette[i] = 16 * vc->vc_par[j++]; |