[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cefa5154-137c-9fc7-25cb-49bd47fd1710@acm.org>
Date: Thu, 28 Apr 2022 20:42:58 -0700
From: Bart Van Assche <bvanassche@....org>
To: Xuezhi Zhang <zhangxuezhi1@...lpad.com>, jejb@...ux.ibm.com,
martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: pmcraid: convert sysfs snprintf to sysfs_emit
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.
Powered by blists - more mailing lists