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-5-tt@turingtested.xyz
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
#include <linux/hwmon-sysfs.h>
#include <linux/err.h>
#include <linux/of.h>
+#include <linux/sysfs.h>
#include <linux/thermal.h>
/*
mutex_unlock(&data->update_lock);
}
- return sprintf(buf, "%d\n", alarm);
+ return sysfs_emit(buf, "%d\n", alarm);
}
static SENSOR_DEVICE_ATTR_RO(gpio1_alarm, alarm, MAX6650_ALRM_GPIO1);