From: Adrian Bunk This patch contains the following cleanups: - make needlessly gloval code static - vt_ioctl.c: removed the global variable keyboard_type since noone did actually set it to any other value Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton --- 25-akpm/drivers/char/vt.c | 17 +++++++++-------- 25-akpm/drivers/char/vt_ioctl.c | 13 +++++-------- 25-akpm/include/linux/keyboard.h | 1 - 25-akpm/include/linux/vt_kern.h | 6 ------ 4 files changed, 14 insertions(+), 23 deletions(-) diff -puN drivers/char/vt.c~drivers-char-vt-cleanups drivers/char/vt.c --- 25/drivers/char/vt.c~drivers-char-vt-cleanups 2005-02-28 17:38:32.000000000 -0800 +++ 25-akpm/drivers/char/vt.c 2005-02-28 17:38:32.000000000 -0800 @@ -144,6 +144,7 @@ static void set_cursor(struct vc_data *v static void hide_cursor(struct vc_data *vc); static void console_callback(void *ignored); static void blank_screen_t(unsigned long dummy); +static void set_palette(struct vc_data *vc); static int printable; /* Is console ready for printing? */ @@ -732,7 +733,7 @@ int vc_allocate(unsigned int currcons) / return 0; } -inline int resize_screen(struct vc_data *vc, int width, int height) +static inline int resize_screen(struct vc_data *vc, int width, int height) { /* Resizes the resolution of the display adapater */ int err = 0; @@ -2138,7 +2139,7 @@ struct tty_driver *console_driver; * The console must be locked when we get here. */ -void vt_console_print(struct console *co, const char *b, unsigned count) +static void vt_console_print(struct console *co, const char *b, unsigned count) { struct vc_data *vc = vc_cons[fg_console].d; unsigned char c; @@ -2233,7 +2234,7 @@ static struct tty_driver *vt_console_dev return console_driver; } -struct console vt_console_driver = { +static struct console vt_console_driver = { .name = "tty", .write = vt_console_print, .device = vt_console_device, @@ -2899,7 +2900,7 @@ void poke_blanked_console(void) * Palettes */ -void set_palette(struct vc_data *vc) +static void set_palette(struct vc_data *vc) { WARN_CONSOLE_UNLOCKED(); @@ -2990,7 +2991,7 @@ void reset_palette(struct vc_data *vc) #define max_font_size 65536 -int con_font_get(struct vc_data *vc, struct console_font_op *op) +static int con_font_get(struct vc_data *vc, struct console_font_op *op) { struct console_font font; int rc = -EINVAL; @@ -3045,7 +3046,7 @@ out: return rc; } -int con_font_set(struct vc_data *vc, struct console_font_op *op) +static int con_font_set(struct vc_data *vc, struct console_font_op *op) { struct console_font font; int rc = -EINVAL; @@ -3102,7 +3103,7 @@ int con_font_set(struct vc_data *vc, str return rc; } -int con_font_default(struct vc_data *vc, struct console_font_op *op) +static int con_font_default(struct vc_data *vc, struct console_font_op *op) { struct console_font font = {.width = op->width, .height = op->height}; char name[MAX_FONT_NAME]; @@ -3132,7 +3133,7 @@ int con_font_default(struct vc_data *vc, return rc; } -int con_font_copy(struct vc_data *vc, struct console_font_op *op) +static int con_font_copy(struct vc_data *vc, struct console_font_op *op) { int con = op->height; int rc; diff -puN drivers/char/vt_ioctl.c~drivers-char-vt-cleanups drivers/char/vt_ioctl.c --- 25/drivers/char/vt_ioctl.c~drivers-char-vt-cleanups 2005-02-28 17:38:32.000000000 -0800 +++ 25-akpm/drivers/char/vt_ioctl.c 2005-02-28 17:38:32.000000000 -0800 @@ -33,7 +33,7 @@ #include #include -char vt_dont_switch; +static char vt_dont_switch; extern struct tty_driver *console_driver; #define VT_IS_IN_USE(i) (console_driver->ttys[i] && console_driver->ttys[i]->count) @@ -52,15 +52,12 @@ extern struct tty_driver *console_driver * to the current console is done by the main ioctl code. */ -/* Keyboard type: Default is KB_101, but can be set by machine - * specific code. - */ -unsigned char keyboard_type = KB_101; - #ifdef CONFIG_X86 #include #endif +static void complete_change_console(struct vc_data *vc); + /* * these are the valid i/o ports we're allowed to change. they map all the * video ports @@ -416,7 +413,7 @@ int vt_ioctl(struct tty_struct *tty, str /* * this is naive. */ - ucval = keyboard_type; + ucval = KB_101; goto setchar; /* @@ -1068,7 +1065,7 @@ void reset_vc(struct vc_data *vc) /* * Performs the back end of a vt switch */ -void complete_change_console(struct vc_data *vc) +static void complete_change_console(struct vc_data *vc) { unsigned char old_vc_mode; diff -puN include/linux/keyboard.h~drivers-char-vt-cleanups include/linux/keyboard.h --- 25/include/linux/keyboard.h~drivers-char-vt-cleanups 2005-02-28 17:38:32.000000000 -0800 +++ 25-akpm/include/linux/keyboard.h 2005-02-28 17:38:32.000000000 -0800 @@ -27,7 +27,6 @@ extern const int NR_TYPES; extern const int max_vals[]; extern unsigned short *key_maps[MAX_NR_KEYMAPS]; extern unsigned short plain_map[NR_KEYS]; -extern unsigned char keyboard_type; #endif #define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */ diff -puN include/linux/vt_kern.h~drivers-char-vt-cleanups include/linux/vt_kern.h --- 25/include/linux/vt_kern.h~drivers-char-vt-cleanups 2005-02-28 17:38:32.000000000 -0800 +++ 25-akpm/include/linux/vt_kern.h 2005-02-28 17:38:32.000000000 -0800 @@ -35,16 +35,11 @@ int vc_cons_allocated(unsigned int conso int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); void vc_disallocate(unsigned int console); void reset_palette(struct vc_data *vc); -void set_palette(struct vc_data *vc); void do_blank_screen(int entering_gfx); void do_unblank_screen(int leaving_gfx); void unblank_screen(void); void poke_blanked_console(void); int con_font_op(struct vc_data *vc, struct console_font_op *op); -int con_font_set(struct vc_data *vc, struct console_font_op *op); -int con_font_get(struct vc_data *vc, struct console_font_op *op); -int con_font_default(struct vc_data *vc, struct console_font_op *op); -int con_font_copy(struct vc_data *vc, struct console_font_op *op); int con_set_cmap(unsigned char __user *cmap); int con_get_cmap(unsigned char __user *cmap); void scrollback(struct vc_data *vc, int lines); @@ -75,7 +70,6 @@ void con_protect_unimap(struct vc_data * int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); /* vt.c */ -void complete_change_console(struct vc_data *vc); int vt_waitactive(int vt); void change_console(struct vc_data *new_vc); void reset_vc(struct vc_data *vc); _