From: Markus Elfring Date: Mon, 1 Dec 2014 04:45:42 +0000 (+0100) Subject: thermal: int3403: Delete a check before thermal_zone_device_unregister() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=931b9c86d9a518b1374157f103168fb787e6560e;p=openwrt%2Fstaging%2Fblogic.git thermal: int3403: Delete a check before thermal_zone_device_unregister() 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 Signed-off-by: Zhang Rui --- diff --git a/drivers/thermal/int340x_thermal/int3403_thermal.c b/drivers/thermal/int340x_thermal/int3403_thermal.c index 6e9fb62eb817..790b8f6da731 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; }