From patchwork Sat Jul 23 17:09:10 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: 9244671 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 4FF4D607D3 for ; Sat, 23 Jul 2016 17:09:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27E0127FA8 for ; Sat, 23 Jul 2016 17:09:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07F07280B0; Sat, 23 Jul 2016 17:09:24 +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 B490D27FA8 for ; Sat, 23 Jul 2016 17:09:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751241AbcGWRJW (ORCPT ); Sat, 23 Jul 2016 13:09:22 -0400 Received: from mout.web.de ([212.227.17.11]:55141 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083AbcGWRJU (ORCPT ); Sat, 23 Jul 2016 13:09:20 -0400 Received: from [192.168.1.2] ([78.53.49.29]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0MMEzJ-1bPeZY0JJt-008369; Sat, 23 Jul 2016 19:09:13 +0200 Subject: [PATCH] memory: omap-gpmc: Delete an unnecessary check before the function call "gpiochip_free_own_desc" To: linux-omap@vger.kernel.org, Roger Quadros , Tony Lindgren 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> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: Date: Sat, 23 Jul 2016 19:09:10 +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:Xbja1yHLoYTrKKsC8+EzujjnD+8nBEHJhOr4LOJVNRWnSbtJVqq SGh8sd0DF3AchIyenMT71JFnRoFjqtHTIDQUU5eOZLMYl7g3xfofDi+equA7b00LV5rIh1f vRQZq/6Ls7B3g8+vnCiRFS49JWAO8XkmSHnpnU/2/VQJ/Db88gUOHnk4Zl6VjPgXDZfHWyj hv6cXedR3AGfeu0joLmig== X-UI-Out-Filterresults: notjunk:1; V01:K0:6aQKfdVGryE=:SRUL8TceIH026XBxkk2D4r 54UM+b+Bb7nNoYR0avVH5GADOkuVE+LMkCVxPf9doVp2Nl/t/6llYEjDlEY83teWLKa1gPRYP YibhRdka8UFsR02csThZI7PIz8j3BUH4ocXWdiBUKOK7f18XTpLFkr6a1vdQTN08BKVZXtfZ1 Gj80w7l0EKk6m6I8sFyWdkyS6z3xqgY+taj15UaGL8NYnQFJBD+NDrRTHelF1E68oTSxHXZVE Y6bT6S+fMjOmfGMXt63gNI2Htc4dtej5dMR1DsHZPJ1euQRlqzyEe0P3jTDqO/O15BwK4B+Bv FiN/QmC8H6Qcr2127+UW9rPIS3Kvu35JC90aqWmDmMTZQnnOD+PVYaPQU9GO5WTeulnqrzbmq vqREfbVmvCeRvsTckOCp3hna+JyUukg7hOV4kftO7r9PNyCOLYMT2x49cruSpCl2n60bosUuj vbfg96igV6Xq04NuV/K7ZAqUyPIYTdU7sCBiqrDIy7AYR+Kwvl2GAUnuThLl9/gAgMPN0V9Ec YfZnBoHifexznM0SQXLa1Cfei9/5LkOb3wPMDAM7PQIVDw4OJjHq9hIR48C6IeVsOy3qrCjhM m6E18qS8qeT/DQ9bIosEoaghG4n7ZuZDCnTPee7095OKjEhuuQk70ZLMZg+Aq9hLKWUgrMeMz q/uYV1aJT8dN0dx/5NWNLNeYJJhRHyR9r1waU+HVdgM/4rOR0x3uhe+FqX/wFTpINARxQGPbm 4nwsR/4iJdFRdJyg/Xstjtw/JoAiqKYw94NXg7/cKSOGJJTxfNuaJwuHk+mC9/QJWbTzuon6J EZGTjY9 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sat, 23 Jul 2016 18:54:02 +0200 The gpiochip_free_own_desc() 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/memory/omap-gpmc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index 869c83f..e138875 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -2143,9 +2143,7 @@ err_child_fail: ret = -ENODEV; err_cs: - if (waitpin_desc) - gpiochip_free_own_desc(waitpin_desc); - + gpiochip_free_own_desc(waitpin_desc); err: gpmc_cs_free(cs);