Skip to contentSkip to conversation

drm/nouveau/hwmon: remove some redundant checks

PATCH In review Dan Carpenter 2 participants 2 messages Feb 6, 2014 – Feb 7, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau/hwmon: remove some redundant checks

No need to check "ret" twice in a row.

drivers/gpu/drm/nouveau/nouveau_hwmon.c +4 -8
index 4aff04fa483c..5e4ab58f4f6b 100644
@@ -587,18 +587,14 @@ nouveau_hwmon_init(struct drm_device *dev)
 
 	/* set the default attributes */
 	ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_default_attrgroup);
-	if (ret) {
-		if (ret)
-			goto error;
-	}
+	if (ret)
+		goto error;
 
 	/* if the card has a working thermal sensor */
 	if (therm->temp_get(therm) >= 0) {
 		ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_temp_attrgroup);
-		if (ret) {
-			if (ret)
-				goto error;
-		}
+		if (ret)
+			goto error;
 	}
 
 	/* if the card has a pwm fan */
#1 lore raw

----- Original Message -----

Quoted 9 lines

From: "Dan Carpenter" <[email protected]>
To: "David Airlie" <[email protected]>
Cc: "Ben Skeggs" <[email protected]>, "Martin Peres" <[email protected]>, "Ilia Mirkin" <[email protected]>, "Dave Airlie" <[email protected]>, [email protected], [email protected]
Sent: Thursday, 6 February, 2014 7:29:43 PM
Subject: [patch] drm/nouveau/hwmon: remove some redundant checks

No need to check "ret" twice in a row.

Got it. Thank you!

Quoted 31 lines
drivers/gpu/drm/nouveau/nouveau_hwmon.c +4 -8
index 4aff04fa483c..5e4ab58f4f6b 100644
@@ -587,18 +587,14 @@ nouveau_hwmon_init(struct drm_device *dev)
 
 	/* set the default attributes */
 	ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_default_attrgroup);
-	if (ret) {
-		if (ret)
-			goto error;
-	}
+	if (ret)
+		goto error;
 
 	/* if the card has a working thermal sensor */
 	if (therm->temp_get(therm) >= 0) {
 		ret = sysfs_create_group(&hwmon_dev->kobj, &hwmon_temp_attrgroup);
-		if (ret) {
-			if (ret)
-				goto error;
-		}
+		if (ret)
+			goto error;
 	}
 
 	/* if the card has a pwm fan */