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] [thread-next>] [day] [month] [year] [list]
Message-ID: <3d96896d-5bb7-4ae5-a6c9-b586337eaa3f@kernel.org>
Date: Wed, 19 Feb 2025 07:24:52 +0100
From: Jiri Slaby <jirislaby@...nel.org>
To: Alexey Gladkov <legion@...nel.org>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>, linux-serial@...r.kernel.org
Subject: Re: [PATCH v1 1/2] tty/vt: Use KVAL instead of use bit operation

On 18. 02. 25, 13:29, Alexey Gladkov wrote:
> The K_HANDLERS always gets KVAL as an argument. It is better to use the
> KVAL macro itself instead of bit operation.
> 
> Signed-off-by: Alexey Gladkov <legion@...nel.org>
> ---
>   drivers/tty/vt/keyboard.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
> index 804355da46f5..7df041ac4d5c 100644
> --- a/drivers/tty/vt/keyboard.c
> +++ b/drivers/tty/vt/keyboard.c
> @@ -885,7 +885,7 @@ static void k_shift(struct vc_data *vc, unsigned char value, char up_flag)
>   		if (kbd->kbdmode == VC_UNICODE)
>   			to_utf8(vc, npadch_value);
>   		else
> -			put_queue(vc, npadch_value & 0xff);
> +			put_queue(vc, KVAL(npadch_value));

While the mask is the same, this is not a kval, right?

>   		npadch_active = false;
>   	}
>   }
> @@ -1519,7 +1519,7 @@ static void kbd_keycode(unsigned int keycode, int down, bool hw_raw)
>   	if ((raw_mode || kbd->kbdmode == VC_OFF) && type != KT_SPEC && type != KT_SHIFT)
>   		return;
>   
> -	(*k_handler[type])(vc, keysym & 0xff, !down);
> +	(*k_handler[type])(vc, KVAL(keysym), !down);

This makes sense.

-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ