]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwmon: (tc74) Replace sprintf() with sysfs_emit()
authorAmay Agarwal <tt@turingtested.xyz>
Tue, 3 Mar 2026 15:24:52 +0000 (20:54 +0530)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 31 Mar 2026 02:45:05 +0000 (19:45 -0700)
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-2-tt@turingtested.xyz
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/tc74.c

index 9984373a25fb7ec0761f6c8a02b29a08bae75234..7fb7b50ad1adbf57a13dd860764af71f895ac853 100644 (file)
@@ -92,7 +92,7 @@ static ssize_t temp_input_show(struct device *dev,
        if (ret)
                return ret;
 
-       return sprintf(buf, "%d\n", data->temp_input * 1000);
+       return sysfs_emit(buf, "%d\n", data->temp_input * 1000);
 }
 static SENSOR_DEVICE_ATTR_RO(temp1_input, temp_input, 0);