[PATCH 1/2] vt: Use boolean as parameter to do_blank_screen() and do_unblank_screen()
From: Thomas Zimmermann
Date: Mon Oct 12 2026 - 05:42:59 EST
The parameters to do_blank_screen() and do_unblank_screen() signal
whether the call is part of a switch between text and graphics mode.
Convert to boolean. No functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
---
drivers/tty/vt/vt.c | 20 ++++++++++----------
drivers/tty/vt/vt_ioctl.c | 12 ++++++------
drivers/video/fbdev/core/fbcon.c | 4 ++--
include/linux/vt_kern.h | 5 +++--
4 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 57edf37495a8..9e7b4419b422 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -3374,7 +3374,7 @@ static void console_callback(struct work_struct *ignored)
scrollback_delta = 0;
}
if (blank_timer_expired) {
- do_blank_screen(0);
+ do_blank_screen(false);
blank_timer_expired = 0;
}
notify_update(vc_cons[fg_console].d);
@@ -3636,7 +3636,7 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
case TIOCL_BLANKSCREEN: /* until explicitly unblanked, not only poked */
scoped_guard(console_lock) {
ignore_poke = 1;
- do_blank_screen(0);
+ do_blank_screen(false);
}
break;
case TIOCL_BLANKEDSCREEN:
@@ -4659,7 +4659,7 @@ static int set_vesa_blanking(u8 __user *mode_user)
return 0;
}
-void do_blank_screen(int entering_gfx)
+void do_blank_screen(bool entering_gfx)
{
struct vc_data *vc = vc_cons[fg_console].d;
int i;
@@ -4671,7 +4671,7 @@ void do_blank_screen(int entering_gfx)
if (console_blanked) {
if (blank_state == blank_vesa_wait) {
blank_state = blank_off;
- vc->vc_sw->con_blank(vc, vesa_blank_mode + 1, 0);
+ vc->vc_sw->con_blank(vc, vesa_blank_mode + 1, false);
}
return;
}
@@ -4680,7 +4680,7 @@ void do_blank_screen(int entering_gfx)
if (entering_gfx) {
hide_cursor(vc);
save_screen(vc);
- vc->vc_sw->con_blank(vc, VESA_VSYNC_SUSPEND, 1);
+ vc->vc_sw->con_blank(vc, VESA_VSYNC_SUSPEND, true);
console_blanked = fg_console + 1;
blank_state = blank_off;
set_origin(vc);
@@ -4702,7 +4702,7 @@ void do_blank_screen(int entering_gfx)
save_screen(vc);
/* In case we need to reset origin, blanking hook returns 1 */
i = vc->vc_sw->con_blank(vc, vesa_off_interval ? VESA_VSYNC_SUSPEND :
- (vesa_blank_mode + 1), 0);
+ (vesa_blank_mode + 1), false);
console_blanked = fg_console + 1;
if (i)
set_origin(vc);
@@ -4721,7 +4721,7 @@ EXPORT_SYMBOL(do_blank_screen);
/*
* Called by timer as well as from vt_console_driver
*/
-void do_unblank_screen(int leaving_gfx)
+void do_unblank_screen(bool leaving_gfx)
{
struct vc_data *vc;
@@ -4767,13 +4767,13 @@ EXPORT_SYMBOL(do_unblank_screen);
/*
* This is called by the outside world to cause a forced unblank, mostly for
- * oopses. Currently, I just call do_unblank_screen(0), but we could eventually
- * call it with 1 as an argument and so force a mode restore... that may kill
+ * oopses. Currently, I just call do_unblank_screen(false), but we could eventually
+ * call it with true as an argument and so force a mode restore... that may kill
* X or at least garbage the screen but would also make the Oops visible...
*/
static void unblank_screen(void)
{
- do_unblank_screen(0);
+ do_unblank_screen(false);
}
/*
diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
index ecefe4a666f2..1241b39d6e68 100644
--- a/drivers/tty/vt/vt_ioctl.c
+++ b/drivers/tty/vt/vt_ioctl.c
@@ -273,9 +273,9 @@ static int vt_kdsetmode(struct vc_data *vc, unsigned long mode)
/* explicitly blank/unblank the screen if switching modes */
if (mode == KD_TEXT)
- do_unblank_screen(1);
+ do_unblank_screen(true);
else
- do_blank_screen(1);
+ do_blank_screen(true);
return 0;
}
@@ -1152,9 +1152,9 @@ static void complete_change_console(struct vc_data *vc)
*/
if (old_vc_mode != vc->vc_mode) {
if (vc->vc_mode == KD_TEXT)
- do_unblank_screen(1);
+ do_unblank_screen(true);
else
- do_blank_screen(1);
+ do_blank_screen(true);
}
/*
@@ -1182,9 +1182,9 @@ static void complete_change_console(struct vc_data *vc)
if (old_vc_mode != vc->vc_mode) {
if (vc->vc_mode == KD_TEXT)
- do_unblank_screen(1);
+ do_unblank_screen(true);
else
- do_blank_screen(1);
+ do_blank_screen(true);
}
}
}
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index 615fa596b7cc..274f6bf6e165 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -3051,9 +3051,9 @@ void fbcon_fb_blanked(struct fb_info *info, int blank)
if (con_is_visible(vc)) {
if (blank)
- do_blank_screen(0);
+ do_blank_screen(false);
else
- do_unblank_screen(0);
+ do_unblank_screen(false);
}
par->blank_state = blank;
}
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index d008c3d0a9bb..b4e3a2543777 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -10,6 +10,7 @@
#include <linux/vt.h>
#include <linux/kd.h>
#include <linux/tty.h>
+#include <linux/types.h>
#include <linux/mutex.h>
#include <linux/console_struct.h>
#include <linux/mm.h>
@@ -29,8 +30,8 @@ int __vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines,
bool from_user);
struct vc_data *vc_deallocate(unsigned int console);
void reset_palette(struct vc_data *vc);
-void do_blank_screen(int entering_gfx);
-void do_unblank_screen(int leaving_gfx);
+void do_blank_screen(bool entering_gfx);
+void do_unblank_screen(bool leaving_gfx);
void poke_blanked_console(void);
int con_font_op(struct vc_data *vc, struct console_font_op *op);
int con_set_cmap(unsigned char __user *cmap);
--
2.55.0