Skip to contentSkip to conversation

bus: fsl-mc: replace snprintf in show functions with sysfs_emit

PATCH New [email protected] 1 participant 1 message Jul 13, 2023 1 message not in the archive QorIQ DPAA2 fsl-mc bus driver

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 bus: fsl-mc: replace snprintf in show functions with sysfs_emit

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

---
 drivers/bus/fsl-mc/fsl-mc-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/fsl-mc/fsl-mc-bus.c +1 -1
index 4352745a923c..c28bde570cb1 100644
@@ -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);