From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752344AbaLAEup (ORCPT ); Sun, 30 Nov 2014 23:50:45 -0500 Received: from mout.web.de ([212.227.15.3]:58013 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752039AbaLAEun (ORCPT ); Sun, 30 Nov 2014 23:50:43 -0500 Message-ID: <547BF398.8010407@users.sourceforge.net> Date: Mon, 01 Dec 2014 05:50:32 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Eduardo Valentin , Zhang Rui , linux-pm@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH 1/1] thermal: int3403: Delete a check before thermal_zone_device_unregister() References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> In-Reply-To: <5317A59D.4@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:dh205Xqkr0l+fdruVsdAI/rhDcJZ2s6ONwSmlntGlzF2yDb1//v 9iCogSig33PPx8aXd6/af1YpdpiMxhnnna11MdKo0QTR2nz7lxP0sYyyPw1DebY/ZMHDAEc LIUAfowfsP6nVqgf8BQ6sfMYf4RohfxDpXkhht7myTk/oKp5pM13O9RHcMoObmKKPVKn4Fq +9MTiGDds3gZRl+9fmOJA== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Markus Elfring 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 --- 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; } -- 2.1.3