mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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>
This commit is contained in:
parent
c9d468ba1b
commit
987bf9bd9d
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user