linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Xiongfeng Wang <wangxiongfeng2@huawei.com>,
	jejb@linux.ibm.com, martin.petersen@oracle.com,
	john.garry@huawei.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	guohanjun@huawei.com
Subject: Re: [PATCH v2] scsi: scsi_transport_sas: add missing newline when printing 'enable' by sysfs
Date: Sat, 18 Jul 2020 13:25:55 -0700	[thread overview]
Message-ID: <88b08a41-55b2-ae5d-fbe5-24439429855f@acm.org> (raw)
In-Reply-To: <1594975472-12486-1-git-send-email-wangxiongfeng2@huawei.com>

On 2020-07-17 01:44, Xiongfeng Wang wrote:
> diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
> index 182fd25..e443dee 100644
> --- a/drivers/scsi/scsi_transport_sas.c
> +++ b/drivers/scsi/scsi_transport_sas.c
> @@ -563,7 +563,7 @@ static ssize_t do_sas_phy_enable(struct device *dev,
>  {
>  	struct sas_phy *phy = transport_class_to_phy(dev);
>  
> -	return snprintf(buf, 20, "%d", phy->enabled);
> +	return snprintf(buf, 20, "%d\n", phy->enabled);
>  }

For future sysfs show function patches, please use PAGE_SIZE as second
snprintf() argument or use sprintf() instead of snprintf() because in
this case it is clear that no output buffer overflow will happen. Using
any other size argument than PAGE_SIZE makes patches like the above
harder to verify than necessary. Anyway:

Reviewed-by: Bart van Assche <bvanassche@acm.org>

  reply	other threads:[~2020-07-18 20:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17  8:44 [PATCH v2] scsi: scsi_transport_sas: add missing newline when printing 'enable' by sysfs Xiongfeng Wang
2020-07-18 20:25 ` Bart Van Assche [this message]
2020-07-20  2:07   ` Xiongfeng Wang
2020-07-21  3:42 ` Martin K. Petersen

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=88b08a41-55b2-ae5d-fbe5-24439429855f@acm.org \
    --to=bvanassche@acm.org \
    --cc=guohanjun@huawei.com \
    --cc=jejb@linux.ibm.com \
    --cc=john.garry@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=wangxiongfeng2@huawei.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;
as well as URLs for NNTP newsgroup(s).