mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
drm: nouveau: Replace sprintf() with sysfs_emit()
Replace sprintf() calls with sysfs_emit() to follow current kernel
coding standards.
sysfs_emit() is the preferred method for formatting sysfs output as it
provides better bounds checking and is more secure.
Signed-off-by: Madhur Kumar <madhurkumar004@gmail.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patch.msgid.link/20251205091804.317801-1-madhurkumar004@gmail.com
Fixes: 11b7d89521 ("drm/nouveau/pm: manual pwm fanspeed management for nv40+ boards")
Cc: <stable@vger.kernel.org> # v3.3+
This commit is contained in:
parent
d84e47edf1
commit
979e2ec58d
|
|
@ -125,7 +125,7 @@ nouveau_hwmon_get_pwm1_max(struct device *d,
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return sprintf(buf, "%i\n", ret);
|
||||
return sysfs_emit(buf, "%i\n", ret);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
|
@ -141,7 +141,7 @@ nouveau_hwmon_get_pwm1_min(struct device *d,
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return sprintf(buf, "%i\n", ret);
|
||||
return sysfs_emit(buf, "%i\n", ret);
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user