Re: [PATCH v18] tty: Fix the keyboard led light display problem

From: Dan Carpenter
Date: Tue Nov 30 2021 - 02:54:30 EST


Hi lianzhi,

url: https://github.com/0day-ci/linux/commits/lianzhi-chang/tty-Fix-the-keyboard-led-light-display-problem/20211129-120853
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: i386-randconfig-m021-20211128 (https://download.01.org/0day-ci/archive/20211129/202111291912.gGbp6mtv-lkp@xxxxxxxxx/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

New smatch warnings:
drivers/tty/vt/keyboard.c:425 vt_set_leds_compute_shiftstate() warn: was && intended here instead of ||?

vim +425 drivers/tty/vt/keyboard.c

63f24a7fafd448 drivers/tty/vt/keyboard.c Jiri Slaby 2021-01-05 414 void vt_set_leds_compute_shiftstate(void)
079c9534a96da9 drivers/tty/vt/keyboard.c Alan Cox 2012-02-28 415 {
560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 416 struct kbd_struct *kb;
079c9534a96da9 drivers/tty/vt/keyboard.c Alan Cox 2012-02-28 417 unsigned long flags;
63f24a7fafd448 drivers/tty/vt/keyboard.c Jiri Slaby 2021-01-05 418
560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 419 /*
560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 420 * When switching VT, according to the value of kb->kbdmode,
560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 421 * judge whether it is necessary to force the keyboard light
560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 422 * state to be issued.
560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 423 */
560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 424 kb = kbd_table + fg_console;
560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 @425 if (kb->kbdmode != VC_RAW ||
560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 426 kb->kbdmode != VC_MEDIUMRAW ||
560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 427 kb->kbdmode != VC_OFF) {

&& was intended instead of ||.

560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 428 vt_switch = true;
63f24a7fafd448 drivers/tty/vt/keyboard.c Jiri Slaby 2021-01-05 429 set_leds();
560757cc1f5e54 drivers/tty/vt/keyboard.c lianzhi chang 2021-11-29 430 }
63f24a7fafd448 drivers/tty/vt/keyboard.c Jiri Slaby 2021-01-05 431
079c9534a96da9 drivers/tty/vt/keyboard.c Alan Cox 2012-02-28 432 spin_lock_irqsave(&kbd_event_lock, flags);
079c9534a96da9 drivers/tty/vt/keyboard.c Alan Cox 2012-02-28 433 do_compute_shiftstate();
079c9534a96da9 drivers/tty/vt/keyboard.c Alan Cox 2012-02-28 434 spin_unlock_irqrestore(&kbd_event_lock, flags);
079c9534a96da9 drivers/tty/vt/keyboard.c Alan Cox 2012-02-28 435 }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx