From patchwork Mon Nov 16 21:23:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7630891 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A27CF9F2E2 for ; Mon, 16 Nov 2015 21:24:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AAC782053D for ; Mon, 16 Nov 2015 21:24:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C44A8203EB for ; Mon, 16 Nov 2015 21:24:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751833AbbKPVXr (ORCPT ); Mon, 16 Nov 2015 16:23:47 -0500 Received: from mout.web.de ([212.227.15.4]:51879 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753132AbbKPVXo (ORCPT ); Mon, 16 Nov 2015 16:23:44 -0500 Received: from [192.168.1.3] ([77.181.163.50]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0LdF3J-1agskK2cPB-00iWwG; Mon, 16 Nov 2015 22:23:13 +0100 Subject: [PATCH 1/3] ste_dma40: Delete an unnecessary check before the function call "kmem_cache_destroy" To: Dan Williams , Linus Walleij , Vinod Koul , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org 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> <564A4899.8040109@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <564A4935.6010307@users.sourceforge.net> Date: Mon, 16 Nov 2015 22:23:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <564A4899.8040109@users.sourceforge.net> X-Provags-ID: V03:K0:tGkqc/ee0CMuKxiOhWsJq8eh2WGXWlV0agGGknu4J04DNPd/aSq jP23F5XqFhnKjbPGpRvFG3OabQ6vpCEbcLr+i3jqK26+L7py5r7GItUBMRoxY8nU0MZDtks YSwMNIP5HqMiB9wj0arP+gx51H4lbnDd8omrW+U9qgzXF648jqosLRZ6hlSFNs+aw7dBmkI taUFmGwBgFbZQdvgE7ArA== X-UI-Out-Filterresults: notjunk:1; V01:K0:lJYYiYUiP8I=:xRf69vjmzEDnqhisrAlvXL qDPtNKRFORi7+eC9rXB2jSjsupZc99UwxWS71e0JDhOzHopZ6w7IXZbEJ6Nwjp4b0l77HExuN J9fWl4JgV6kw6OAwlr6WguWbhjwZhqukKFKR+Te8wQSySB8to4yzQm3/cAjrTnGkMb3I82ldj WzltMML+jX0b3/UvtkUjxJ6nnEA3DlTDMwKPPqCqRElR5HnzhcVkEgOvsirn7fkTMCRWG/My3 Th3LeSDxIQD0jgPJNj+Af4Hj7IpgK6pEN1vh19RRJpr03PcLLC8RTRidBFGtGdNTVUyCS/eWo MDjIdAWbRVtVlaQWmqhALYJ4a0yH8yVTNB+VBf4caXF7yh0bmWURzqBtNXo6x2PZ8obbbhLLz zp+v3D90smpbhrDbFp6Gc6DoQ1ZK2o/rVoWD9Cc1/PDTWPHwkpPmeplSJ1DleoQIvvVb+HkTU FjfvK2mcs6Lc+D40r7uFdHAhL58C4uRwi7CUYaUaN+kCKpDOk5wIRoGl0Appq1aYDUagv8Vlv Mw8yE2RDVAquvmZr3WkP5OPft8fioLp+y+2xyFhc5hZUJNef7NOT6bync7M7CEwHBEpOmghcG QB5nYVkCTOthhQFVpoN0GnO6CBWcSf+3BWVmdcs0VlA2pXjXQTEOjkA84lBrgqgk7dk2UCNoe zB1iKMvcFUVXZFj9939DYZkhQW2mcrz7DzphOP1mR35T4spYqhpVX2ZnA7kMv1uLPHGYNW5fN O/wHznCw7r7ChkSn5Rg92Kk/aOzGlGm2n0+O77sWVcBKLnZORM5Pz8qwD6REB0xwYoITLalbv 4QuVCM6 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Mon, 16 Nov 2015 20:26:27 +0100 The kmem_cache_destroy() 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 Acked-by: Linus Walleij --- drivers/dma/ste_dma40.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index dd3e7ba..9132ae0 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3694,8 +3694,7 @@ static int __init d40_probe(struct platform_device *pdev) failure: if (base) { - if (base->desc_slab) - kmem_cache_destroy(base->desc_slab); + kmem_cache_destroy(base->desc_slab); if (base->virtbase) iounmap(base->virtbase);