mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: cgel.zte@gmail.com
Cc: gregkh@linuxfoundation.org, jirislaby@kernel.org,
	macro@orcam.me.uk, fancer.lancer@gmail.com, andrew@aj.id.au,
	pali@kernel.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jing Yao <yao.jing2@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] drivers: tty: replace snprintf in show functions with sysfs_emit
Date: Thu, 28 Oct 2021 14:22:13 +0200	[thread overview]
Message-ID: <YXqV9V0eWhqFTc+i@hovoldconsulting.com> (raw)
In-Reply-To: <20211028101350.14172-1-yao.jing2@zte.com.cn>

On Thu, Oct 28, 2021 at 10:13:50AM +0000, cgel.zte@gmail.com wrote:
> From: Jing Yao <yao.jing2@zte.com.cn>

Where's the commit message?

Also, look at the log for the driver you're changing for the Subject
prefix you should use. Including "drivers:" is never right.

> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Jing Yao <yao.jing2@zte.com.cn>
> ---
>  drivers/tty/serial/8250/8250_port.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index 5775cbff8f6e..557e8b13b5c1 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -3099,7 +3099,7 @@ static ssize_t rx_trig_bytes_show(struct device *dev,
>  	if (rxtrig_bytes < 0)
>  		return rxtrig_bytes;
>  
> -	return snprintf(buf, PAGE_SIZE, "%d\n", rxtrig_bytes);
> +	return sysfs_emit(buf, PAGE_SIZE, "%d\n", rxtrig_bytes);

FFS... This would not even compile, at least not without a warning, as
it's completely broken.

You do know that you have to at least compile-test your patches, right?

>  }
>  
>  static int do_set_rxtrig(struct tty_port *port, unsigned char bytes)

Johan

  reply	other threads:[~2021-10-28 12:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 10:13 cgel.zte
2021-10-28 12:22 ` Johan Hovold [this message]
2021-10-28 12:49   ` Maciej W. Rozycki
2021-10-28 20:57 ` kernel test robot
2021-10-28 23:49 ` kernel test robot
2021-10-29  5:44 ` Greg KH
2021-10-31 15:34   ` Joe Perches
2021-11-02  6:52     ` [PATCH v2] " cgel.zte
2021-11-02  7:44       ` Johan Hovold
2021-11-04 11:47         ` [PATCH v3] serial: 8250: " cgel.zte
2021-11-08  9:54           ` Johan Hovold

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=YXqV9V0eWhqFTc+i@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=andrew@aj.id.au \
    --cc=cgel.zte@gmail.com \
    --cc=fancer.lancer@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=pali@kernel.org \
    --cc=yao.jing2@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /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®