Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Hugo Villeneuve <hugo@hugovil.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: Jacky Huang <ychuang3@nuvoton.com>,
	Shan-Chun Hung <schung@nuvoton.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH 2/2] serial: ma35d1: Improve logging for out-of-bound console setup
Date: Mon, 4 Dec 2023 15:47:42 -0500	[thread overview]
Message-ID: <20231204154742.3aec6ab62378df433677102b@hugovil.com> (raw)
In-Reply-To: <20231204163804.1331415-3-andi.shyti@kernel.org>

On Mon,  4 Dec 2023 17:38:04 +0100
Andi Shyti <andi.shyti@kernel.org> wrote:

> An out-of-bound index results in an error and should not be
> logged merely as a debug message; it requires at least a warning
> level. Therefore, use pr_warn() instead of pr_debug.
> 
> Additionally, the log message itself has been improved for
> clarity.
> 
> Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
> Cc: Jacky Huang <ychuang3@nuvoton.com>
> ---
>  drivers/tty/serial/ma35d1_serial.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/ma35d1_serial.c b/drivers/tty/serial/ma35d1_serial.c
> index 21b574f78b861..bcc402b4c0b2f 100644
> --- a/drivers/tty/serial/ma35d1_serial.c
> +++ b/drivers/tty/serial/ma35d1_serial.c
> @@ -599,7 +599,8 @@ static int __init ma35d1serial_console_setup(struct console *co, char *options)
>  	int flow = 'n';
>  
>  	if ((co->index < 0) || (co->index >= MA35_UART_NR)) {
> -		pr_debug("Console Port%x out of range\n", co->index);
> +		pr_warn("Failed to write on cononsole port %x, out of range\n",
> +			co->index);

Hi,
I do not see why this improves clarity...

You also introduced a syntax error "cononsole".

Hugo.


>  		return -EINVAL;
>  	}
>  
> -- 
> 2.43.0
> 
> 


-- 
Hugo Villeneuve

  reply	other threads:[~2023-12-04 20:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 16:38 [PATCH 0/2] serial ma35d1 imrpovements Andi Shyti
2023-12-04 16:38 ` [PATCH 1/2] serial: ma35d1: Validate console index before assignment Andi Shyti
2023-12-04 16:38 ` [PATCH 2/2] serial: ma35d1: Improve logging for out-of-bound console setup Andi Shyti
2023-12-04 20:47   ` Hugo Villeneuve [this message]
2023-12-04 21:22     ` Andi Shyti

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=20231204154742.3aec6ab62378df433677102b@hugovil.com \
    --to=hugo@hugovil.com \
    --cc=andi.shyti@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=schung@nuvoton.com \
    --cc=ychuang3@nuvoton.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