* [PATCH] bus: fsl-mc: Replace snprintf() with sysfs_emit()
@ 2022-04-27 9:00 Jiapeng Chong
0 siblings, 0 replies; only message in thread
From: Jiapeng Chong @ 2022-04-27 9:00 UTC (permalink / raw)
To: stuyoder; +Cc: laurentiu.tudor, linux-kernel, Jiapeng Chong, Abaci Robot
coccicheck complains about the use of snprintf() in sysfs show
functions.
Fix the coccicheck warning:
./drivers/bus/fsl-mc/fsl-mc-bus.c:186:8-16: WARNING: use scnprintf or
sprintf.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
drivers/bus/fsl-mc/fsl-mc-bus.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index ba01c7f4de92..9a91fd5c888d 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -183,7 +183,7 @@ static ssize_t driver_override_show(struct device *dev,
{
struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
- return snprintf(buf, PAGE_SIZE, "%s\n", mc_dev->driver_override);
+ return sysfs_emit(buf, "%s\n", mc_dev->driver_override);
}
static DEVICE_ATTR_RW(driver_override);
--
2.20.1.7.g153144c
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-27 9:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 9:00 [PATCH] bus: fsl-mc: Replace snprintf() with sysfs_emit() Jiapeng Chong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®