diff mbox series

[drivers/iio,2/3] iio: light: Convert sysfs sprintf/snprintf family to sysfs_emit

Message ID 1618216751-1678-3-git-send-email-tiantao6@hisilicon.com (mailing list archive)
State New
Headers show
Series convert sysfs sprintf/snprintf/scnprintf to sysfs_emit | expand

Commit Message

Tian Tao April 12, 2021, 8:39 a.m. UTC
Fix the following coccicheck warning:
drivers/iio/light/veml6030.c:131:8-16: WARNING:
use scnprintf or sprintf

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/iio/light/veml6030.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/iio/light/veml6030.c b/drivers/iio/light/veml6030.c
index de85c9b..3c937c5 100644
--- a/drivers/iio/light/veml6030.c
+++ b/drivers/iio/light/veml6030.c
@@ -128,7 +128,7 @@  static ssize_t in_illuminance_period_available_show(struct device *dev,
 		return -EINVAL;
 	}
 
-	return snprintf(buf, PAGE_SIZE, "%s\n", period_values[x]);
+	return sysfs_emit(buf, "%s\n", period_values[x]);
 }
 
 static IIO_DEVICE_ATTR_RO(in_illuminance_period_available, 0);