summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmay Agarwal <tt@turingtested.xyz>2026-03-03 18:24:56 +0300
committerGuenter Roeck <linux@roeck-us.net>2026-03-31 05:45:05 +0300
commit987bf9bd9d6ceb2f6e6f73414e35cd573999fc3d (patch)
tree1c2aace1ca6b4ce928f31918afeaa9021530e5c7
parentc9d468ba1bf222e61f886b46748696cd940e43a4 (diff)
downloadlinux-987bf9bd9d6ceb2f6e6f73414e35cd573999fc3d.tar.xz
hwmon: (emc1403) 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-6-tt@turingtested.xyz Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/emc1403.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c
index ccce948a4306..964a8cb278f1 100644
--- a/drivers/hwmon/emc1403.c
+++ b/drivers/hwmon/emc1403.c
@@ -40,7 +40,7 @@ static ssize_t power_state_show(struct device *dev, struct device_attribute *att
retval = regmap_read(data->regmap, 0x03, &val);
if (retval < 0)
return retval;
- return sprintf(buf, "%d\n", !!(val & BIT(6)));
+ return sysfs_emit(buf, "%d\n", !!(val & BIT(6)));
}
static ssize_t power_state_store(struct device *dev, struct device_attribute *attr,