Commit 5de81d9b authored by Amay Agarwal's avatar Amay Agarwal Committed by Guenter Roeck
Browse files

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: default avatarAmay Agarwal <tt@turingtested.xyz>
Link: https://lore.kernel.org/r/20260303152456.35763-4-tt@turingtested.xyz


[groeck: Fixed continuation line alignment]
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent aeb651cc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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));
}