public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Xuezhi Zhang <zhangxuezhi1@coolpad.com>,
	jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scsi: pmcraid: convert sysfs snprintf to sysfs_emit
Date: Thu, 28 Apr 2022 20:42:58 -0700	[thread overview]
Message-ID: <cefa5154-137c-9fc7-25cb-49bd47fd1710@acm.org> (raw)
In-Reply-To: <20220428070245.255827-1-zhangxuezhi1@coolpad.com>

On 4/28/22 00:02, Xuezhi Zhang wrote:
> Fix the following coccicheck warnings:
> drivers/scsi/pmcraid.c:3591:8-16:
> WARNING: use scnprintf or sprintf
> drivers/scsi/pmcraid.c:3557:8-16:
> WARNING: use scnprintf or sprintf
> drivers/scsi/pmcraid.c:3496:8-16:
> WARNING: use scnprintf or sprintf

I'm not sure the above is sufficient as motivation for this patch. The 
current code looks fine to me. Why to change the snprintf() calls into 
sysfs_emit() calls?

> @@ -3554,8 +3554,7 @@ static ssize_t pmcraid_show_drv_version(
>   	char *buf
>   )
>   {
> -	return snprintf(buf, PAGE_SIZE, "version: %s\n",
> -			PMCRAID_DRIVER_VERSION);
> +	return sysfs_emt(buf, "version: %s\n", PMCRAID_DRIVER_VERSION);
>   }

Something tells me that this patch has not been tested at all - not even 
compile tested. Are you perhaps checking whether it is possible to get a 
broken patch in the kernel tree?

Bart.

      parent reply	other threads:[~2022-04-29  3:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28  7:02 [PATCH] scsi: pmcraid: convert sysfs snprintf to sysfs_emit Xuezhi Zhang
2022-04-28 15:22 ` Martin K. Petersen
2022-04-29  3:42 ` Bart Van Assche [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=cefa5154-137c-9fc7-25cb-49bd47fd1710@acm.org \
    --to=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=zhangxuezhi1@coolpad.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