linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/12] vt: move set_leds to keyboard.c
@ 2021-01-05 12:02 Jiri Slaby
  2021-01-05 12:02 ` [PATCH 02/12] vt: keyboard, make keyboard_tasklet local Jiri Slaby
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Jiri Slaby @ 2021-01-05 12:02 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, linux-kernel, Jiri Slaby

set_leds and compute_shiftstate are called from a single place in vt.c.
Let's combine these two into vt_set_leds_compute_shiftstate. This allows
for making keyboard_tasklet local in the next patch.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/tty/vt/keyboard.c | 11 ++++++++++-
 drivers/tty/vt/vt.c       |  3 +--
 include/linux/kbd_kern.h  |  8 +-------
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index 52922d21a49f..32ec4242b1f2 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -372,6 +372,12 @@ static void to_utf8(struct vc_data *vc, uint c)
 	}
 }
 
+/* FIXME: review locking for vt.c callers */
+static void set_leds(void)
+{
+	tasklet_schedule(&keyboard_tasklet);
+}
+
 /*
  * Called after returning from RAW mode or when changing consoles - recompute
  * shift_down[] and shift_state from key_down[] maybe called when keymap is
@@ -401,9 +407,12 @@ static void do_compute_shiftstate(void)
 }
 
 /* We still have to export this method to vt.c */
-void compute_shiftstate(void)
+void vt_set_leds_compute_shiftstate(void)
 {
 	unsigned long flags;
+
+	set_leds();
+
 	spin_lock_irqsave(&kbd_event_lock, flags);
 	do_compute_shiftstate();
 	spin_unlock_irqrestore(&kbd_event_lock, flags);
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index d04a162939a4..fe4fedbc0386 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1036,8 +1036,7 @@ void redraw_screen(struct vc_data *vc, int is_switch)
 	}
 	set_cursor(vc);
 	if (is_switch) {
-		set_leds();
-		compute_shiftstate();
+		vt_set_leds_compute_shiftstate();
 		notify_update(vc);
 	}
 }
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index 82f29aa35062..adf98004624b 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -71,12 +71,6 @@ extern void (*kbd_ledfunc)(unsigned int led);
 extern int set_console(int nr);
 extern void schedule_console_callback(void);
 
-/* FIXME: review locking for vt.c callers */
-static inline void set_leds(void)
-{
-	tasklet_schedule(&keyboard_tasklet);
-}
-
 static inline int vc_kbd_mode(struct kbd_struct * kbd, int flag)
 {
 	return ((kbd->modeflags >> flag) & 1);
@@ -135,7 +129,7 @@ static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
 
 struct console;
 
-void compute_shiftstate(void);
+void vt_set_leds_compute_shiftstate(void);
 
 /* defkeymap.c */
 
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-01-07 15:17 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 12:02 [PATCH 01/12] vt: move set_leds to keyboard.c Jiri Slaby
2021-01-05 12:02 ` [PATCH 02/12] vt: keyboard, make keyboard_tasklet local Jiri Slaby
2021-01-05 12:02 ` [PATCH 03/12] vt: keyboard, defkeymap.c_shipped, approach the definitions Jiri Slaby
2021-01-05 12:02 ` [PATCH 04/12] vt: keyboard, defkeymap.c_shipped, approach the unicode table Jiri Slaby
2021-01-05 12:02 ` [PATCH 05/12] tty: pty, remove BUG_ON from pty_close Jiri Slaby
2021-01-05 12:02 ` [PATCH 06/12] 8250_tegra: clean up tegra_uart_handle_break Jiri Slaby
2021-01-05 12:02 ` [PATCH 07/12] vt/consolemap: do font sum unsigned Jiri Slaby
2021-01-05 12:02 ` [PATCH 08/12] vt: drop old FONT ioctls Jiri Slaby
2021-01-05 12:02 ` [PATCH 09/12] vgacon: drop BROKEN_GRAPHICS_PROGRAMS Jiri Slaby
2021-01-05 12:02 ` [PATCH 10/12] tty: cpm_uart, use port->flags instead of low_latency Jiri Slaby
2021-01-05 12:02 ` [PATCH 11/12] tty_port: drop last traces " Jiri Slaby
2021-01-05 12:02 ` [PATCH 12/12] tty: drop termiox user definitions Jiri Slaby
2021-01-07 15:18 ` [PATCH 01/12] vt: move set_leds to keyboard.c Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).