From: Wan Jiabing <wanjiabing@vivo.com>
To: Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>,
Kashyap Desai <kashyap.desai@broadcom.com>,
Sumit Saxena <sumit.saxena@broadcom.com>,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
mpi3mr-linuxdrv.pdl@broadcom.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Wan Jiabing <wanjiabing@vivo.com>
Subject: [PATCH] scsi: mpi3mr: Replace snprintf with sysfs_emit in adp_state_show
Date: Thu, 5 May 2022 14:17:42 +0800 [thread overview]
Message-ID: <20220505061742.1657020-1-wanjiabing@vivo.com> (raw)
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
reply other threads:[~2022-05-05 6:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220505061742.1657020-1-wanjiabing@vivo.com \
--to=wanjiabing@vivo.com \
--cc=jejb@linux.ibm.com \
--cc=kashyap.desai@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mpi3mr-linuxdrv.pdl@broadcom.com \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
--cc=sumit.saxena@broadcom.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 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.