From patchwork Mon Jul 18 18:54:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9235129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 382E560865 for ; Mon, 18 Jul 2016 18:55:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28E3B20453 for ; Mon, 18 Jul 2016 18:55:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D094205B0; Mon, 18 Jul 2016 18:55:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B506120453 for ; Mon, 18 Jul 2016 18:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751717AbcGRSzU (ORCPT ); Mon, 18 Jul 2016 14:55:20 -0400 Received: from mout.web.de ([212.227.15.14]:63766 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751587AbcGRSzT (ORCPT ); Mon, 18 Jul 2016 14:55:19 -0400 Received: from [192.168.1.2] ([77.181.186.47]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MMZck-1bQtRv1LJu-008GxA; Mon, 18 Jul 2016 20:54:25 +0200 Subject: [PATCH] hwmon-ntc_thermistor: Delete an unnecessary check before the function call "iio_channel_release" To: linux-hwmon@vger.kernel.org, =?UTF-8?B?R8O8bnRlciBSw7Zjaw==?= , Jean Delvare 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> From: SF Markus Elfring Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Message-ID: <60ce7b63-99f8-67c2-319c-21b2d4199263@users.sourceforge.net> Date: Mon, 18 Jul 2016 20:54:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:ZNZxrpLqbdDJO7x3NdaDoOHQ9UDTp36/KdPDNtA9kJqDvaj010M /uh3btTFTyCMeZR5+AyBkhNrhiEgvmPnmuCU3SsXgXN9/r7UXdh8JNkFsAkblZqX4B3hggy iKzADJeC1NjOZkSmas21PH1kQqsTOaMUrdzmmjKLtlcMNd0sT5kqTbj9aGtn0vAVL9ghKi9 4dQKH/kNEpO9T5e1SZHbA== X-UI-Out-Filterresults: notjunk:1; V01:K0:2l3dDspc2kg=:9Op/NZ/w5Fre20i1loc6E8 wkJt9n2K9cxF+XlmW60wF7l1elVQ2Nsltg/kFD0KksEkU5T+QACPUK6pTOGd3cO3KQknzdyLH EkWiOZ8HOghP2m6awDjhEBB4b5ED6KNZbipOemh4brg3U7kUPVdUK04t3j3vSeHwi1vQ6mD3s PaWXQ+Cd7YzgXtBOg74RiygFDKncoWz+aN+yuY20TvxDnlzLF/TDngmBQ1G9M3yPQVqEyjlMu sjYNW9r/VvSxK4sSsVIDjPz1YsD5A72Fl3AxgrQBvnlYy1g1VjnoLF0HMo5BU2vlxkwX4rVWl xgSMwa3NHKt18JAocQSJVWcMycNxKZtrPoYVrX1AeciiwQsvVi4MaRlLSQ8GpC1ZxLIHwkRti pRv43GChoGW58+KJFhpbG1J4aQDS17/mveB/IK5YkiUtBsAPmuvF5+fS4hyUPuFogHc+vmAy9 bIenp5n4Np5nbmxXHzK2AkTXejbE/JS8b015OGI+Bc5Info0L77XjOpiEc3llz5H7eLFgkzTL 3cbtyCxLKH0AadIklEQeE7Ds/TDRmkHdEETfvigw80YydtbldvgTOCY3YzJwHZjbl2bh8wBKF cBiXHKE3C66Ohik0RPaYtGe/Cdc5aqtvrKal9dU5f2uSTXfCNrxAXCP2blOV+dieKNe8g1ct6 aiGrR0iSZY9W4198xPj/YGxB5rIIId2xjcKFY09NmUkyMXTaRrOYnjTIQY393HlPMpUD2fuhY kiZWtNShJlshI4NV15fj3YedRjxlxcfE9J1sgjdcrT6AYoJ2Pt9KM9Gp4nXxTMS9JqZ9GFn2q KDq9hNT Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Mon, 18 Jul 2016 20:34:41 +0200 The iio_channel_release() 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/hwmon/ntc_thermistor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c index 8ef7b71..100878a 100644 --- a/drivers/hwmon/ntc_thermistor.c +++ b/drivers/hwmon/ntc_thermistor.c @@ -361,8 +361,7 @@ ntc_thermistor_parse_dt(struct platform_device *pdev) } static void ntc_iio_channel_release(struct ntc_thermistor_platform_data *pdata) { - if (pdata->chan) - iio_channel_release(pdata->chan); + iio_channel_release(pdata->chan); } #else static struct ntc_thermistor_platform_data *