mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Fwd: [PATCH] bus: fsl-mc: replace snprintf in show functions with sysfs_emit
       [not found] <tencent_FA44C0B483B542E72F0227D54F9516E3EA08@qq.com>
@ 2023-07-13  9:58 ` hanyu001
  0 siblings, 0 replies; only message in thread
From: hanyu001 @ 2023-07-13  9:58 UTC (permalink / raw)
  To: stuyoder, laurentiu.tudor; +Cc: linux-kernel

show() should not use snprintf() when formatting the value to be
returned to user space.

Fix the following coccicheck warning:
drivers/media/i2c/ccs/ccs-core.c:3761: WARNING: use scnprintf or 
sprintf.

./drivers/bus/fsl-mc/fsl-mc-bus.c:204:8-16: WARNING: use scnprintf or 
sprintf

Signed-off-by: ztt <1549089851@qq.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 4352745a923c..c28bde570cb1 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -201,7 +201,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 scnprintf(buf, PAGE_SIZE, "%s\n", mc_dev->driver_override);
  }
  static DEVICE_ATTR_RW(driver_override);

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

only message in thread, other threads:[~2023-07-13  9:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <tencent_FA44C0B483B542E72F0227D54F9516E3EA08@qq.com>
2023-07-13  9:58 ` Fwd: [PATCH] bus: fsl-mc: replace snprintf in show functions with sysfs_emit hanyu001

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®