lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 26 Nov 2021 17:51:44 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     lianzhi chang <changlianzhi@...ontech.com>
Cc:     linux-kernel@...r.kernel.org, dmitry.torokhov@...il.com,
        gregkh@...uxfoundation.org, jirislaby@...nel.org, 282827961@...com
Subject: Re: [PATCH v17] tty: Fix the keyboard led light display problem

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ