All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] drm/nouveau/hwmon: remove some redundant checks
@ 2014-02-06  9:29 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-02-06  9:29 UTC (permalink / raw)
  To: David Airlie
  Cc: Martin Peres, kernel-janitors, dri-devel, Ben Skeggs, Dave Airlie

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
index 4aff04fa483c..5e4ab58f4f6b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
@@ -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 */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch] drm/nouveau/hwmon: remove some redundant checks
@ 2014-02-06  9:29 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-02-06  9:29 UTC (permalink / raw)
  To: David Airlie
  Cc: Martin Peres, kernel-janitors, dri-devel, Ben Skeggs, Dave Airlie

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

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
index 4aff04fa483c..5e4ab58f4f6b 100644
--- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
@@ -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 */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] drm/nouveau/hwmon: remove some redundant checks
  2014-02-06  9:29 ` Dan Carpenter
@ 2014-02-07  5:37   ` Ben Skeggs
  -1 siblings, 0 replies; 4+ messages in thread
From: Ben Skeggs @ 2014-02-07  5:37 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Martin Peres, kernel-janitors, dri-devel, Dave Airlie

----- Original Message -----
> From: "Dan Carpenter" <dan.carpenter@oracle.com>
> To: "David Airlie" <airlied@linux.ie>
> Cc: "Ben Skeggs" <bskeggs@redhat.com>, "Martin Peres" <martin.peres@labri.fr>, "Ilia Mirkin" <imirkin@alum.mit.edu>,
> "Dave Airlie" <airlied@redhat.com>, dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org
> 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!

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
> b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
> index 4aff04fa483c..5e4ab58f4f6b 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
> @@ -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 */
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] drm/nouveau/hwmon: remove some redundant checks
@ 2014-02-07  5:37   ` Ben Skeggs
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Skeggs @ 2014-02-07  5:37 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Martin Peres, kernel-janitors, dri-devel, Dave Airlie

----- Original Message -----
> From: "Dan Carpenter" <dan.carpenter@oracle.com>
> To: "David Airlie" <airlied@linux.ie>
> Cc: "Ben Skeggs" <bskeggs@redhat.com>, "Martin Peres" <martin.peres@labri.fr>, "Ilia Mirkin" <imirkin@alum.mit.edu>,
> "Dave Airlie" <airlied@redhat.com>, dri-devel@lists.freedesktop.org, kernel-janitors@vger.kernel.org
> 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!

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
> b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
> index 4aff04fa483c..5e4ab58f4f6b 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_hwmon.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_hwmon.c
> @@ -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 */
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-07  5:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-06  9:29 [patch] drm/nouveau/hwmon: remove some redundant checks Dan Carpenter
2014-02-06  9:29 ` Dan Carpenter
2014-02-07  5:37 ` Ben Skeggs
2014-02-07  5:37   ` Ben Skeggs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.