[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100913213613.223e10a5@lxorguk.ukuu.org.uk>
Date: Mon, 13 Sep 2010 21:36:13 +0100
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Joe Perches <joe@...ches.com>
Cc: linux-kernel@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>, sparclinux@...r.kernel.org
Subject: Re: [PATCH 18/25] drivers/serial/suncore.c: Use static const char
arrays
On Mon, 13 Sep 2010 12:47:56 -0700
Joe Perches <joe@...ches.com> wrote:
> Signed-off-by: Joe Perches <joe@...ches.com>
> ---
> drivers/serial/suncore.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/serial/suncore.c b/drivers/serial/suncore.c
> index 6381a02..f2a5b54 100644
> --- a/drivers/serial/suncore.c
> +++ b/drivers/serial/suncore.c
> @@ -84,8 +84,8 @@ EXPORT_SYMBOL(sunserial_console_match);
>
> void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
> {
> + char mode_prop[sizeof("ttyX-mode")];
> const char *mode, *s;
> - char mode_prop[] = "ttyX-mode";
> int baud, bits, stop, cflag;
> char parity;
>
> @@ -106,7 +106,7 @@ void sunserial_console_termios(struct console *con, struct device_node *uart_dp)
> if (of_console_options)
> c = *of_console_options;
>
> - mode_prop[3] = c;
> + sprintf(mode_prop, "tty%c-mode", c);
Whats the point of all this. It's trivial code being replaced by
something complicated, harder to understand and much slower ?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists