All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: pmcraid: Replace snprintf in show functions with sysfs_emit
@ 2021-12-03 11:51 Yihao Han
  0 siblings, 0 replies; only message in thread
From: Yihao Han @ 2021-12-03 11:51 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen, linux-scsi, linux-kernel
  Cc: kernel, Yihao Han

Use sysfs_emit instead of scnprintf or sprintf makes more sense.

Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
 drivers/scsi/pmcraid.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 2fe7a0019fff..551713d33838 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -3984,7 +3984,7 @@ static ssize_t pmcraid_show_log_level(
 	struct Scsi_Host *shost = class_to_shost(dev);
 	struct pmcraid_instance *pinstance =
 		(struct pmcraid_instance *)shost->hostdata;
-	return snprintf(buf, PAGE_SIZE, "%d\n", pinstance->current_log_level);
+	return sysfs_emit(buf, "%d\n", pinstance->current_log_level);
 }
 
 /**
@@ -4045,7 +4045,7 @@ static ssize_t pmcraid_show_drv_version(
 	char *buf
 )
 {
-	return snprintf(buf, PAGE_SIZE, "version: %s\n",
+	return sysfs_emit(buf, "version: %s\n",
 			PMCRAID_DRIVER_VERSION);
 }
 
@@ -4079,7 +4079,7 @@ static ssize_t pmcraid_show_adapter_id(
 		pinstance->pdev->devfn;
 	u32 aen_group = pmcraid_event_family.id;
 
-	return snprintf(buf, PAGE_SIZE,
+	return sysfs_emit(buf,
 			"adapter id: %d\nminor: %d\naen group: %d\n",
 			adapter_id, MINOR(pinstance->cdev.dev), aen_group);
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-03 11:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 11:51 [PATCH] scsi: pmcraid: Replace snprintf in show functions with sysfs_emit Yihao Han

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.