[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <n58o097s-s20p-4222-nqo5-2qp26843rs35@onlyvoer.pbz>
Date: Fri, 23 May 2025 13:13:58 -0400 (EDT)
From: Nicolas Pitre <npitre@...libre.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>
cc: linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] vt: remove redundant condition from redraw_screen()
Given !con_is_visible(vc) is the equivalent of *vc->vc_display_fg != vc
we have:
struct vc_data *old_vc = vc_cons[fg_console].d;
if (old_vc == vc)
return;
*vc->vc_display_fg = vc;
if (*vc->vc_display_fg != old_vc) /* !con_is_visible(old_vc) */
...
Therefore the last if condition is always true.
Signed-off-by: Nicolas Pitre <npitre@...libre.com>
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index ed39d9cb4432..af5186d2c219 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -946,10 +946,8 @@ void redraw_screen(struct vc_data *vc, int is_switch)
*vc->vc_display_fg = vc;
fg_console = vc->vc_num;
hide_cursor(old_vc);
- if (!con_is_visible(old_vc)) {
- save_screen(old_vc);
- set_origin(old_vc);
- }
+ save_screen(old_vc);
+ set_origin(old_vc);
if (tty0dev)
sysfs_notify(&tty0dev->kobj, NULL, "active");
} else {
Powered by blists - more mailing lists