Displaying 5 results from an estimated 5 matches for "nvkm_therm_attr_thrs_fan_boost_hyst".
2023 Mar 01
1
[PATCH RESEND] drm/nouveau/hwmon: Use sysfs_emit in show function callsbacks
..._temp(struct device *d,
@@ -87,8 +87,8 @@ 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",
-	 therm->attr_get(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST_HYST) * 1000);
+	return sysfs_emit(buf, "%d\n",
+			  therm->attr_get(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST_HYST) * 1000);
 }
 static ssize_t
 nouveau_hwmon_set_temp1_auto_point1_temp_hyst(struct device *d,
-- 
2.34.1
2017 Jul 17
2
[PATCH] drm/nouveau/hwmon: Uninitialized variables in sysfs
...struct nouveau_drm *drm = nouveau_drm(dev);
 	struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
 	long value;
+	int ret;
 
-	if (kstrtol(buf, 10, &value) == -EINVAL)
-		return count;
+	ret = kstrtol(buf, 10, &value);
+	if (ret)
+		return ret;
 
 	therm->attr_set(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST_HYST,
 			value / 1000);
@@ -156,8 +160,9 @@ nouveau_hwmon_set_pwm1_min(struct device *d, struct device_attribute *a,
 	long value;
 	int ret;
 
-	if (kstrtol(buf, 10, &value) == -EINVAL)
-		return -EINVAL;
+	ret = kstrtol(buf, 10, &value);
+	if (ret)
+		return ret;
 
 	ret = therm->attr_set(...
2023 Mar 07
0
[PATCH RESEND] drm/nouveau/hwmon: Use sysfs_emit in show function callsbacks
...@ -87,8 +87,8 @@ 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",
> -	 therm->attr_get(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST_HYST) * 1000);
> +	return sysfs_emit(buf, "%d\n",
> +			  therm->attr_get(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST_HYST) * 1000);
>  }
>  static ssize_t
>  nouveau_hwmon_set_temp1_auto_point1_temp_hyst(struct device *d,
-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Re...
2017 Jul 22
0
[PATCH] drm/nouveau/hwmon: Uninitialized variables in sysfs
...ruct nvkm_therm *therm = nvxx_therm(&drm->client.device);
>  	long value;
> +	int ret;
>  
> -	if (kstrtol(buf, 10, &value) == -EINVAL)
> -		return count;
> +	ret = kstrtol(buf, 10, &value);
> +	if (ret)
> +		return ret;
>  
>  	therm->attr_set(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST_HYST,
>  			value / 1000);
> @@ -156,8 +160,9 @@ nouveau_hwmon_set_pwm1_min(struct device *d, struct device_attribute *a,
>  	long value;
>  	int ret;
>  
> -	if (kstrtol(buf, 10, &value) == -EINVAL)
> -		return -EINVAL;
> +	ret = kstrtol(buf, 10, &value);
> +	if (ret)...
2018 Jul 11
0
[PATCH] drm/nouveau/hwmon: potential uninitialized variables
...@ nouveau_hwmon_set_temp1_auto_point1_temp_hyst(struct device *d,
 	struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
 	long value;
 
-	if (kstrtol(buf, 10, &value) == -EINVAL)
-		return count;
+	if (kstrtol(buf, 10, &value))
+		return -EINVAL;
 
 	therm->attr_set(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST_HYST,
 			value / 1000);
@@ -156,7 +156,7 @@ nouveau_hwmon_set_pwm1_min(struct device *d, struct device_attribute *a,
 	long value;
 	int ret;
 
-	if (kstrtol(buf, 10, &value) == -EINVAL)
+	if (kstrtol(buf, 10, &value))
 		return -EINVAL;
 
 	ret = therm->attr_set(therm, NVKM_THERM_ATTR_FAN_M...