From: Thomas Zimmermann <tzimmermann@suse.de>
To: gregkh@linuxfoundation.org, jirislaby@kernel.org, deller@gmx.de,
James.Bottomley@HansenPartnership.com, simona@ffwll.ch
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
linux-fbdev@vger.kernel.org, linux-parisc@vger.kernel.org,
sashiko-reviews@lists.linux.dev,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 1/2] vt: Use boolean as parameter to do_blank_screen() and do_unblank_screen()
Date: Mon, 12 Oct 2026 11:27:38 +0200 [thread overview]
Message-ID: <20261012094114.38549-2-tzimmermann@suse.de> (raw)
In-Reply-To: <20261012094114.38549-1-tzimmermann@suse.de>
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@suse.de>
---
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
next prev parent reply other threads:[~2026-10-12 9:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 9:27 [PATCH 0/2] vt: Simplify console-blanking interface Thomas Zimmermann
2026-10-12 9:27 ` Thomas Zimmermann [this message]
2026-10-12 11:30 ` [PATCH 1/2] vt: Use boolean as parameter to do_blank_screen() and do_unblank_screen() Greg KH
2026-10-12 12:28 ` Thomas Zimmermann
2026-10-12 12:41 ` Thomas Zimmermann
2026-10-12 16:13 ` Greg KH
2026-10-12 9:27 ` [PATCH 2/2] vt: Distinguish between blanking and VESA blank mode in con_blank Thomas Zimmermann
2026-10-12 11:29 ` Greg KH
2026-10-12 12:08 ` Thomas Zimmermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261012094114.38549-2-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=deller@gmx.de \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=simona@ffwll.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®