From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933538AbbBCKV1 (ORCPT ); Tue, 3 Feb 2015 05:21:27 -0500 Received: from mout.web.de ([212.227.15.4]:54297 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932169AbbBCKVW (ORCPT ); Tue, 3 Feb 2015 05:21:22 -0500 Message-ID: <54D0A11A.4070906@users.sourceforge.net> Date: Tue, 03 Feb 2015 11:21:14 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Eduardo Valentin , Zhang Rui , linux-omap@vger.kernel.org, linux-pm@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH] ti-soc-thermal: Delete an unnecessary check before the function call "cpufreq_cooling_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:qOpwXTwaOreIMXKTVIRfUl9HW7gvxf95vr/iZpYJFBrSMmSDNYI 5D2Hk58o2Up4c/8u3c69QqvQIVv+Xlum7f1mzZj9/tUlQvw5Y7IM/4Sfn2lUfo92R/ZXNMe +hHTd1CdLj5HthUElALwdLFBIMR4YyjEZht5UjDKS5+k1Eo7SRw9EOdxIE7DqWn5wsfshjq /B+YqbhSrRndWX8C5lG5w== 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: Tue, 3 Feb 2015 11:15:14 +0100 The cpufreq_cooling_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/ti-soc-thermal/ti-thermal-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c index 3fb054a..a38c175 100644 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c @@ -429,7 +429,7 @@ int ti_thermal_unregister_cpu_cooling(struct ti_bandgap *bgp, int id) data = ti_bandgap_get_sensor_data(bgp, id); - if (data && data->cool_dev) + if (data) cpufreq_cooling_unregister(data->cool_dev); return 0; -- 2.2.2