summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAmay Agarwal <tt@turingtested.xyz>2026-03-03 20:54:54 +0530
committerGuenter Roeck <linux@roeck-us.net>2026-03-30 19:45:05 -0700
commit5de81d9b9ff6a26f3f7e75f0aa93b26cc81acd86 (patch)
treeb0195730ceace22462b43d1a304bdf975ed82349 /drivers
parentaeb651cc95e83ccf129ba9151dd22101619dea1e (diff)
hwmon: (ads7828) Replace sprintf() with sysfs_emit()
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@turingtested.xyz> Link: https://lore.kernel.org/r/20260303152456.35763-4-tt@turingtested.xyz [groeck: Fixed continuation line alignment] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/ads7828.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
index 436637264056..7f43565ca284 100644
--- a/drivers/hwmon/ads7828.c
+++ b/drivers/hwmon/ads7828.c
@@ -62,8 +62,8 @@ static ssize_t ads7828_in_show(struct device *dev,
if (err < 0)
return err;
- return sprintf(buf, "%d\n",
- DIV_ROUND_CLOSEST(regval * data->lsb_resol, 1000));
+ return sysfs_emit(buf, "%d\n",
+ DIV_ROUND_CLOSEST(regval * data->lsb_resol, 1000));
}
static SENSOR_DEVICE_ATTR_RO(in0_input, ads7828_in, 0);