From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: Jiri Slaby <jirislaby@kernel.org>,
Alexey Gladkov <legion@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>,
Thomas Gleixner <tglx@kernel.org>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH v2] tty: vt/keyboard: Hoist and reuse variable in vt_do_kdgkb_ioctl
Date: Thu, 12 Mar 2026 16:56:41 +0100 [thread overview]
Message-ID: <2026031236-diminish-dugout-8283@gregkh> (raw)
In-Reply-To: <6AD2F599-396F-42B5-B918-DC5A2CB7B64B@linux.dev>
On Thu, Mar 12, 2026 at 04:30:00PM +0100, Thorsten Blum wrote:
> On 12. Mar 2026, at 15:18, Greg Kroah-Hartman wrote:
> > On Mon, Mar 02, 2026 at 04:32:52PM +0100, Thorsten Blum wrote:
> >> Hoist 'len' and use it in both cases.
> >
> > Why? And what is "both cases"?
>
> To reuse 'len' in both switch cases (KDGKBSENT and KDSKBSENT) instead of
> defining 'len = sizeof(user_kdgkb->kb_string)' in KDGKBSENT and inlining
> sizeof(user_kdgkb->kb_string) in KDSKBSENT.
As the sizeof() turns into a static number, the code is a bit simpler
as-is, right?
And there's no real need to change this for the sake of changing it that
I can see.
> >> + /*
> >> + * Ownership transfer: vt_kdskbsent() returns a pointer
> >> + * that must be freed (new buffer, old buffer, or NULL).
> >> + */
> >> kbs = vt_kdskbsent(kbs, kb_func);
> >
> > That's fine, but what does it have to do with len?
>
> It's unrelated to 'len' and just a drive-by change while I was at it.
Which, by default, makes this patch impossible to accept :(
thanks,
greg k-h
prev parent reply other threads:[~2026-03-12 15:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 15:32 [PATCH v2] tty: vt/keyboard: Hoist and reuse variable in vt_do_kdgkb_ioctl Thorsten Blum
2026-03-12 14:18 ` Greg Kroah-Hartman
2026-03-12 15:30 ` Thorsten Blum
2026-03-12 15:56 ` Greg Kroah-Hartman [this message]
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=2026031236-diminish-dugout-8283@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=legion@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=myrrhperiwinkle@qtmlabs.xyz \
--cc=nathan@kernel.org \
--cc=tglx@kernel.org \
--cc=thorsten.blum@linux.dev \
/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