From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: lianzhi chang <changlianzhi@uniontech.com>
Cc: linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com,
gregkh@linuxfoundation.org, jirislaby@kernel.org,
282827961@qq.com
Subject: Re: [PATCH v17] tty: Fix the keyboard led light display problem
Date: Fri, 26 Nov 2021 17:51:44 +0200 [thread overview]
Message-ID: <YaECkE+Tc7btwAEO@smile.fi.intel.com> (raw)
In-Reply-To: <20211126112727.14939-1-changlianzhi@uniontech.com>
On Fri, Nov 26, 2021 at 07:27:27PM +0800, lianzhi chang wrote:
> By judging the value of kb->kbdmode to determine whether it is necessary
> to forcibly set the led state of the keyboard when switching between
> different ttys. Solve the problem of the inconsistency between the
> keyboard led status and the keyboard lock status in some scenarios,
> such as the scenario where the desktop and tty switch mutually.
Since it will be a next version, see one comment below you may address as well.
...
> + /*
> + * When switching VT, according to the value of kb->kbdmode,
> + * judge whether it is necessary to force the keyboard light
> + * state to be issued.
> + */
> + kb = kbd_table + fg_console;
> + if (kb->kbdmode == VC_RAW ||
> + kb->kbdmode == VC_MEDIUMRAW ||
> + kb->kbdmode == VC_OFF) {
checkpatch usually complains on indentation above.
Can you simply do it like
if (kb->kbdmode == VC_RAW ||
kb->kbdmode == VC_MEDIUMRAW ||
kb->kbdmode == VC_OFF) {
?
Alternatively it might be converted to a switch-case, but it takes more LOCs.
switch {
case VC_RAW:
case VC_MEDIUMRAW :
case VC_OFF:
vt_switch = true;
set_leds();
break;
default:
break;
}
> + vt_switch = true;
> + set_leds();
> + }
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2021-11-26 15:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-26 11:27 [PATCH v17] tty: Fix the keyboard led light display problem lianzhi chang
2021-11-26 15:31 ` Greg KH
2021-11-26 15:51 ` Andy Shevchenko [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=YaECkE+Tc7btwAEO@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=282827961@qq.com \
--cc=changlianzhi@uniontech.com \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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