diff mbox

[1/1] thermal: int3403: Delete a check before thermal_zone_device_unregister()

Message ID 547BF398.8010407@users.sourceforge.net (mailing list archive)
State Accepted, archived
Delegated to: Zhang Rui
Headers show

Commit Message

SF Markus Elfring Dec. 1, 2014, 4:50 a.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 Dec 2014 05:45:42 +0100

The thermal_zone_device_unregister() function tests whether its argument
is NULL and then returns immediately. Thus the test around the call
is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/thermal/int340x_thermal/int3403_thermal.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Zhang, Rui Dec. 8, 2014, 4:15 a.m. UTC | #1
On Mon, 2014-12-01 at 05:50 +0100, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 1 Dec 2014 05:45:42 +0100
> 
> The thermal_zone_device_unregister() function tests whether its argument
> is NULL and then returns immediately. Thus the test around the call
> is not needed.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

applied.

thanks,
rui
> ---
>  drivers/thermal/int340x_thermal/int3403_thermal.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/int340x_thermal/int3403_thermal.c b/drivers/thermal/int340x_thermal/int3403_thermal.c
> index 6e9fb62..790b8f6 100644
> --- a/drivers/thermal/int340x_thermal/int3403_thermal.c
> +++ b/drivers/thermal/int340x_thermal/int3403_thermal.c
> @@ -293,8 +293,7 @@ static int int3403_sensor_add(struct int3403_priv *priv)
>  	return 0;
>  
>   err_free_obj:
> -	if (obj->tzone)
> -		thermal_zone_device_unregister(obj->tzone);
> +	thermal_zone_device_unregister(obj->tzone);
>  	return result;
>  }
>  


--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/thermal/int340x_thermal/int3403_thermal.c b/drivers/thermal/int340x_thermal/int3403_thermal.c
index 6e9fb62..790b8f6 100644
--- a/drivers/thermal/int340x_thermal/int3403_thermal.c
+++ b/drivers/thermal/int340x_thermal/int3403_thermal.c
@@ -293,8 +293,7 @@  static int int3403_sensor_add(struct int3403_priv *priv)
 	return 0;
 
  err_free_obj:
-	if (obj->tzone)
-		thermal_zone_device_unregister(obj->tzone);
+	thermal_zone_device_unregister(obj->tzone);
 	return result;
 }