* [Nouveau] [PATCH] drm/nouveau/hwmon: convert sysfs snprintf to sysfs_emit
@ 2021-04-08 11:11 Carlis
0 siblings, 0 replies; only message in thread
From: Carlis @ 2021-04-08 11:11 UTC (permalink / raw)
To: bskeggs, airlied, daniel; +Cc: nouveau, Xuezhi Zhang, linux-kernel, dri-devel
From: Xuezhi Zhang <zhangxuezhi1@yulong.com>
Fix the following coccicheck warning:
drivers/gpu/drm//nouveau/nouveau_hwmon.c:44:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm//nouveau/nouveau_hwmon.c:57:8-16:
WARNING: use scnprintf or sprintf
drivers/gpu/drm//nouveau/nouveau_hwmon.c:90:8-16:
WARNING: use scnprintf or sprintf
Signed-off-by: Xuezhi Zhang <zhangxuezhi1@yulong.com>
---
drivers/gpu/drm/nouveau/nouveau_hwmon.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
index 1c3104d20571..c6e5ee9ece6d 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
@@ -41,7 +41,7 @@ static ssize_t
nouveau_hwmon_show_temp1_auto_point1_pwm(struct device *d,
struct device_attribute *a, char *buf)
{
- return snprintf(buf, PAGE_SIZE, "%d\n", 100);
+ return sysfs_emit(buf, "%d\n", 100);
}
static SENSOR_DEVICE_ATTR(temp1_auto_point1_pwm, 0444,
nouveau_hwmon_show_temp1_auto_point1_pwm, NULL, 0);
@@ -54,7 +54,7 @@ nouveau_hwmon_temp1_auto_point1_temp(struct device *d,
struct nouveau_drm *drm = nouveau_drm(dev);
struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
- return snprintf(buf, PAGE_SIZE, "%d\n",
+ return sysfs_emit(buf, "%d\n",
therm->attr_get(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST) * 1000);
}
static ssize_t
@@ -87,7 +87,7 @@ nouveau_hwmon_temp1_auto_point1_temp_hyst(struct device *d,
struct nouveau_drm *drm = nouveau_drm(dev);
struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
- return snprintf(buf, PAGE_SIZE, "%d\n",
+ return sysfs_emit(buf, "%d\n",
therm->attr_get(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST_HYST) * 1000);
}
static ssize_t
--
2.25.1
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-04-09 12:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 11:11 [Nouveau] [PATCH] drm/nouveau/hwmon: convert sysfs snprintf to sysfs_emit Carlis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).