* [PATCH] scsi: mpi3mr: Replace snprintf with sysfs_emit in adp_state_show
@ 2022-05-05 6:17 Wan Jiabing
0 siblings, 0 replies; only message in thread
From: Wan Jiabing @ 2022-05-05 6:17 UTC (permalink / raw)
To: Sathya Prakash Veerichetty, Kashyap Desai, Sumit Saxena,
Sreekanth Reddy, James E.J. Bottomley, Martin K. Petersen,
mpi3mr-linuxdrv.pdl, linux-scsi, linux-kernel
Cc: Wan Jiabing
Fix following coccicheck warning:
./drivers/scsi/mpi3mr/mpi3mr_app.c:1588:8-16: WARNING: use scnprintf or sprintf
Use sysfs_emit instead of snprintf and fix some comments.
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
drivers/scsi/mpi3mr/mpi3mr_app.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c
index 73bb7992d5a8..86a7206548e4 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_app.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_app.c
@@ -1559,12 +1559,12 @@ void mpi3mr_bsg_init(struct mpi3mr_ioc *mrioc)
}
/**
- * adapter_state_show - SysFS callback for adapter state show
+ * adp_state_show - SysFS callback for adapter state show
* @dev: class device
* @attr: Device attributes
* @buf: Buffer to copy
*
- * Return: snprintf() return after copying adapter state
+ * Return: sysfs_emit() return after copying adapter state
*/
static ssize_t
adp_state_show(struct device *dev, struct device_attribute *attr,
@@ -1585,7 +1585,7 @@ adp_state_show(struct device *dev, struct device_attribute *attr,
else
adp_state = MPI3MR_BSG_ADPSTATE_OPERATIONAL;
- return snprintf(buf, PAGE_SIZE, "%u\n", adp_state);
+ return sysfs_emit(buf, "%u\n", adp_state);
}
static DEVICE_ATTR_RO(adp_state);
--
2.36.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-05 6:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 6:17 [PATCH] scsi: mpi3mr: Replace snprintf with sysfs_emit in adp_state_show Wan Jiabing
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).