Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: jirislaby@kernel.org, deller@gmx.de,
	James.Bottomley@hansenpartnership.com, simona@ffwll.ch,
	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
Subject: Re: [PATCH 1/2] vt: Use boolean as parameter to do_blank_screen() and do_unblank_screen()
Date: Mon, 12 Oct 2026 18:13:48 +0200	[thread overview]
Message-ID: <2026101205-deserve-flinch-d584@gregkh> (raw)
In-Reply-To: <6f774188-86ef-4a84-84c9-d8e45fa3db45@suse.de>

On Mon, Oct 12, 2026 at 02:41:34PM +0200, Thomas Zimmermann wrote:
> 
> 
> Am 12.10.26 um 14:28 schrieb Thomas Zimmermann:
> > Hi
> > 
> > Am 12.10.26 um 13:30 schrieb Greg KH:
> > > On Mon, Oct 12, 2026 at 11:27:38AM +0200, Thomas Zimmermann wrote:
> > > > 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);
> > > Same type of comment here, this bool doesn't really tell what is
> > > happening at all (not your fault, 0/1 doesn't either.)
> > > 
> > > I'm all for this patch but shouldn't this be fixed up to be 2 different
> > > named functions entirely?
> > 
> > Can you elaborate?  Do you mean there should be a separate helper and
> > callback for switching between KD_TEXT and KD_GRAPHICS?
> > 
> > Looking through the *_blank_screen() helpers and the console
> > implementations, I think we'd mostly duplicate code. Mode-switching and
> > blanking are tightly coupled.  Semantics get a bit cleaner with the
> > change you proposed to patch 1, I think.
> 
> And looking even further, it's not entirely clear why consw.con_blank even
> receives the mode_switch parameter.  The consoles track it with some
> internal state, but all of the mode information is available in struct
> vc_data.vc_mode as well.  I think mode_switch and similar booleans could be
> replaced with using vc_mode directly.

Yeah, that would be best overall, as the structure has the "state"
needed, no need to keep it separate in random variables.  This is some
old code before we all learned not to have global variables :)

thanks,

greg k-h

  reply	other threads:[~2026-10-12 16:13 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 ` [PATCH 1/2] vt: Use boolean as parameter to do_blank_screen() and do_unblank_screen() Thomas Zimmermann
2026-10-12 11:30   ` Greg KH
2026-10-12 12:28     ` Thomas Zimmermann
2026-10-12 12:41       ` Thomas Zimmermann
2026-10-12 16:13         ` Greg KH [this message]
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=2026101205-deserve-flinch-d584@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=deller@gmx.de \
    --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 \
    --cc=tzimmermann@suse.de \
    /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