From: Jiri Slaby <jirislaby@kernel.org>
To: Colin Ian King <colin.i.king@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
linux-serial@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] serial: 8250_mtk: make two read-only arrays static const
Date: Tue, 8 Mar 2022 07:31:27 +0100 [thread overview]
Message-ID: <0eff632e-4a9d-f593-72de-243ff4c7733f@kernel.org> (raw)
In-Reply-To: <20220307230055.168241-1-colin.i.king@gmail.com>
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@gmail.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
prev parent reply other threads:[~2022-03-08 6:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-07 23:00 Colin Ian King
2022-03-08 6:31 ` Jiri Slaby [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=0eff632e-4a9d-f593-72de-243ff4c7733f@kernel.org \
--to=jirislaby@kernel.org \
--cc=colin.i.king@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-serial@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
/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
all inboxes | Powered by JetHome®