Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1269751

[PATCH 1/4] crypto-ixp4xx: Delete unnecessary checks before the function call "dma_pool_destroy"

Path csiph.com!news.mixmin.net!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 1/4] crypto-ixp4xx: Delete unnecessary checks before the function call "dma_pool_destroy"
Date Sun, 15 Nov 2015 20:00:02 +0100
Message-ID <qvaGS-55G-19@gated-at.bofh.it> (permalink)
References <mSsDN-4wa-35@gated-at.bofh.it> <mSsDN-4wa-37@gated-at.bofh.it> <mSsDN-4wa-39@gated-at.bofh.it> <mSsDN-4wa-41@gated-at.bofh.it> <mSsDN-4wa-43@gated-at.bofh.it> <mSsDN-4wa-45@gated-at.bofh.it> <mSsDN-4wa-47@gated-at.bofh.it> <mSsDN-4wa-49@gated-at.bofh.it> <mSsDN-4wa-51@gated-at.bofh.it> <mSsDN-4wa-53@gated-at.bofh.it> <mSsDN-4wa-55@gated-at.bofh.it> <mSsDN-4wa-57@gated-at.bofh.it> <mSsDN-4wa-59@gated-at.bofh.it> <mSsDN-4wa-61@gated-at.bofh.it> <mSsDN-4wa-63@gated-at.bofh.it> <mSsDN-4wa-65@gated-at.bofh.it> <mSsDN-4wa-33@gated-at.bofh.it> <qvaxb-526-7@gated-at.bofh.it>
X-Original-To "David S. Miller" <davem@davemloft.net>, Herbert Xu <herbert@gondor.apana.org.au>, linux-crypto@vger.kernel.org
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Provags-ID V03:K0:54Sd9mlQf0wCexpy7sIzOUQZWsPXTErl9E7lSVLVmmtzkHhh+Ld dbmA38w7IHAOUdzLdl4Luq5rz6P9euFgz1P4otNMP/Hr3ZgDRdGbIm93gq+/orJxHdY8Dlt QfIaCLNhlOGzB8hzL031smE+Q4FgOO0c/jYsZ1cr6UYfD9aifbjABTn2WVqftcawy/pCLtY mSGcXX1IYFuaL2iIT1cdg==
X-Ui-Out-Filterresults notjunk:1;V01:K0:a8YXVjfhULc=:d5In/i2GWTx7EbmyLYf5+B uQihflwaRfSflCv7jc2UampvmqgOvRwYx8RDiM6CMKns9pOjwGZ7jBaYMINLC3gekAygVG/th T8qMYwpnX5RfuTiPgv8xppU8X9vHzIX/euPGgVdO4KaGNuurAiOSCen50uGC0+CY4H4a+8u+p pOPTUlY6Had9NPeIPGgEqskwGF00RHkWg8KihBegxgUnVHDIi1NVlVdGVdNwYn5fThRZS1heG Vfx88Pr0CIKpOc4wLJW2Ym51qA+YLm7aUQrahsF0vm7ZRSNeodagOZ3Fqv7EqNJqwtygKsbex ZySYrACGf1IXKuSaifSQX32pVHgpV3bUFb6JCh7k8Xo0utfIdldzSfHzdrGVpn/UxV6hV/nBi ULGwQFAmHnr9LnFk71UCQSrxoNT27ybtv29YcxlILEdCs6jDku1MIh54lkKGrZ66IrHARPEB0 1UnQ1FQdfB9OMJ7Irkio1HJC0+q8W8dNS3P6AsO84EyXBJsIkjel8+iLitxscpBEIUyx75BCN GPKTx8hx7kf9D4nozwVnIRFi8CTNx0Qw69WdhslIdotgla6r/R3g5pcF9YbnHOOWjXi7XsSlL eLvzlRew23SqAMmX0nzXwDby43uURV9oDt6r8LQeV/imNe791IqODzpEYUuBYoqZB9V7l9wf3 kbDyVnGXYClfJ9b8NQ/N7HePAvaKMKP/9gg9pKAJ80pBTACS6md8+2kKmWTW+kTj6UhGrAkqL v5utMESCIoAtD7qjJVWHhNrmUSyEyJojnWe/9uujmLU5Bxu+RLZKM/0if9uqzJwOCIVEQoGIe Dklf6DD
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 37
Organization linux.* mail to news gateway
X-Original-Cc LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org, Julia Lawall <julia.lawall@lip6.fr>
X-Original-Date Sun, 15 Nov 2015 19:49:16 +0100
X-Original-Message-ID <5648D3AC.6090904@users.sourceforge.net>
X-Original-References <5307CAA2.8060406@users.sourceforge.net> <alpine.DEB.2.02.1402212321410.2043@localhost6.localdomain6> <530A086E.8010901@users.sourceforge.net> <alpine.DEB.2.02.1402231635510.1985@localhost6.localdomain6> <530A72AA.3000601@users.sourceforge.net> <alpine.DEB.2.02.1402240658210.2090@localhost6.localdomain6> <530B5FB6.6010207@users.sourceforge.net> <alpine.DEB.2.10.1402241710370.2074@hadrien> <530C5E18.1020800@users.sourceforge.net> <alpine.DEB.2.10.1402251014170.2080@hadrien> <530CD2C4.4050903@users.sourceforge.net> <alpine.DEB.2.10.1402251840450.7035@hadrien> <530CF8FF.8080600@users.sourceforge.net> <alpine.DEB.2.02.1402252117150.2047@localhost6.localdomain6> <530DD06F.4090703@users.sourceforge.net> <alpine.DEB.2.02.1402262129250.2221@localhost6.localdomain6> <5317A59D.4@users.sourceforge.net> <5648D2C1.8050603@users.sourceforge.net>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1269751

Show key headers only | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 15 Nov 2015 16:51:21 +0100

The dma_pool_destroy() function tests whether its argument is NULL
and then returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/crypto/ixp4xx_crypto.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c
index 8f27903..e52496a 100644
--- a/drivers/crypto/ixp4xx_crypto.c
+++ b/drivers/crypto/ixp4xx_crypto.c
@@ -510,10 +510,8 @@ npe_error:
 	printk(KERN_ERR "%s not responding\n", npe_name(npe_c));
 	ret = -EIO;
 err:
-	if (ctx_pool)
-		dma_pool_destroy(ctx_pool);
-	if (buffer_pool)
-		dma_pool_destroy(buffer_pool);
+	dma_pool_destroy(ctx_pool);
+	dma_pool_destroy(buffer_pool);
 	npe_release(npe_c);
 	return ret;
 }
-- 
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] crypto-ixp4xx: Deletion of a few unnecessary checks SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-15 19:50 +0100
  [PATCH 2/4] crypto-ixp4xx: Two function calls less in  init_ixp_crypto() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-15 20:00 +0100
    Re: [PATCH 2/4] crypto-ixp4xx: Two function calls less in  init_ixp_crypto() after error detection Herbert Xu <herbert@gondor.apana.org.au> - 2015-11-17 14:50 +0100
  [PATCH 4/4] crypto-ixp4xx: Less function calls in init_ixp_crypto()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-15 20:00 +0100
  [PATCH 3/4] crypto-ixp4xx: Reduce assignment for a variable in  init_ixp_crypto() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-15 20:00 +0100
    Re: [PATCH 3/4] crypto-ixp4xx: Reduce assignment for a variable in  init_ixp_crypto() Herbert Xu <herbert@gondor.apana.org.au> - 2015-11-17 14:50 +0100
  [PATCH 1/4] crypto-ixp4xx: Delete unnecessary checks before the  function call "dma_pool_destroy" SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-15 20:00 +0100
    Re: [PATCH 1/4] crypto-ixp4xx: Delete unnecessary checks before the  function call "dma_pool_destroy" Herbert Xu <herbert@gondor.apana.org.au> - 2015-11-17 15:20 +0100
  [PATCH v2 0/3] crypto-ixp4xx: Deletion of a few unnecessary checks SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-17 16:40 +0100
    [PATCH v2 2/3] crypto-ixp4xx: Reduce assignment for a variable in  init_ixp_crypto() SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-17 16:50 +0100
    [PATCH v2 3/3] crypto-ixp4xx: Less function calls in  init_ixp_crypto() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-17 16:50 +0100
    [PATCH v2 1/3] crypto-ixp4xx: Delete unnecessary checks before the  function call "dma_pool_destroy" SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-17 16:50 +0100
    Re: [PATCH v2 0/3] crypto-ixp4xx: Deletion of a few unnecessary  checks Herbert Xu <herbert@gondor.apana.org.au> - 2015-11-18 01:10 +0100
      Re: crypto-ixp4xx: Deletion of a few unnecessary checks SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-18 08:30 +0100

csiph-web