[PATCH v2 3/5] hwmon: (ads7828) Replace sprintf() with sysfs_emit()

From: Amay Agarwal

Date: Tue Mar 03 2026 - 10:29:34 EST


Replace sprintf() with sysfs_emit() when writing to sysfs buffers.

sysfs_emit() performs proper bounds checking and is the preferred
helper for sysfs output.

No functional change intended.

Signed-off-by: Amay Agarwal <tt@xxxxxxxxxxxxxxxx>
---
drivers/hwmon/ads7828.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
index 436637264056..a09de9d016ac 100644
--- a/drivers/hwmon/ads7828.c
+++ b/drivers/hwmon/ads7828.c
@@ -62,7 +62,7 @@ static ssize_t ads7828_in_show(struct device *dev,
if (err < 0)
return err;

- return sprintf(buf, "%d\n",
+ return sysfs_emit(buf, "%d\n",
DIV_ROUND_CLOSEST(regval * data->lsb_resol, 1000));
}

--
2.53.0