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]
Message-ID: <0eff632e-4a9d-f593-72de-243ff4c7733f@kernel.org>
Date:   Tue, 8 Mar 2022 07:31:27 +0100
From:   Jiri Slaby <jirislaby@...nel.org>
To:     Colin Ian King <colin.i.king@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        linux-serial@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-mediatek@...ts.infradead.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] serial: 8250_mtk: make two read-only arrays static const

On 08. 03. 22, 0:00, Colin Ian King wrote:
> Don't populate the read-only arrays fraction_L_mapping and
> fraction_M_mapping on the stack but instead make them static
> const. Also makes the object code a little smaller.
> 
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
> ---
>   drivers/tty/serial/8250/8250_mtk.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_mtk.c b/drivers/tty/serial/8250/8250_mtk.c
> index fb65dc601b23..f4a0caa56f84 100644
> --- a/drivers/tty/serial/8250/8250_mtk.c
> +++ b/drivers/tty/serial/8250/8250_mtk.c
> @@ -289,10 +289,10 @@ static void
>   mtk8250_set_termios(struct uart_port *port, struct ktermios *termios,
>   			struct ktermios *old)
>   {
> -	unsigned short fraction_L_mapping[] = {
> +	static const unsigned short fraction_L_mapping[] = {
>   		0, 1, 0x5, 0x15, 0x55, 0x57, 0x57, 0x77, 0x7F, 0xFF, 0xFF
>   	};
> -	unsigned short fraction_M_mapping[] = {
> +	static const unsigned short fraction_M_mapping[] = {
>   		0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 3
>   	};

And perhaps make them both unsigned char?

thanks,
-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ