From patchwork Thu Sep 15 14:44:34 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: 9333843 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 33AC76077A for ; Thu, 15 Sep 2016 14:44:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2771E298C1 for ; Thu, 15 Sep 2016 14:44:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C002298C6; Thu, 15 Sep 2016 14:44:50 +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 AC80B298C1 for ; Thu, 15 Sep 2016 14:44:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750945AbcIOOos (ORCPT ); Thu, 15 Sep 2016 10:44:48 -0400 Received: from mout.web.de ([217.72.192.78]:62993 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbcIOOor (ORCPT ); Thu, 15 Sep 2016 10:44:47 -0400 Received: from [192.168.1.2] ([77.181.210.244]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MdLo7-1bSjlm0V7L-00IS2e; Thu, 15 Sep 2016 16:44:37 +0200 Subject: [PATCH 5/6] crypto-caamhash: Delete an unnecessary initialisation in seven functions To: linux-crypto@vger.kernel.org, "David S. Miller" , Herbert Xu , Labbe Corentin , Russell King References: <566ABCD9.1060404@users.sourceforge.net> <970e9e1b-c1dc-eb28-b380-92c15e9b1961@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: Date: Thu, 15 Sep 2016 16:44:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <970e9e1b-c1dc-eb28-b380-92c15e9b1961@users.sourceforge.net> X-Provags-ID: V03:K0:QrhvveCWO1C58ongpM7OvBVuRYWrEVBhBdiHPljqFtojbtw9ngE 04echFoytkrYSU7qWb/kVU7gUhPA7NKpMBaE34UP3z5Odx8qRzyb5DxasPLk8x1rsmLqGMo Xw40jbYbpddLaiAhN1MpOoBh3uo/ixkoxYevImY3Rr2pZbCWXbSsq5Qzc/phzwpo3Umumgm jG6TD90zVUoE5bQYorJeg== X-UI-Out-Filterresults: notjunk:1; V01:K0:VygXh7nA6Go=:htqcpFZ0Bn3DNg1jT+BPsk F8SZSv2WBAjbuRsHcYhY97DSwTFuc2zM9+ibBjZh0qGjWw+c4ArzgnRX27syouC6V1iU2EOIx 13cztEL8kVs3dr8cEzfmoqh7eHQE/3EoKlxPqkFYPCtNKIaKlz2NKAe2HtJ7GcnozI/37ygMf xv3ypUAuBaDS8JiLKLXaK/NhTsvE4V7aU83AFG3+5fkNm9LjRlbgDRsIk0F6k77/AcWrJF3/n 07iVG259+mY6z7hEzIMmq43FNG3CeV3OY5Ix5HVdmVMqVwBEI6AhN+c3Rs6EBHkgC2Rfj8sE7 ojMd7tASymRNQHRGYG9ROPKV8I3Q3brcVWSgU6xCVkEpKrkNwgZ1wRm5y5Dd9JQap++BIQJNI CkOR/kf/PrjJukQGHkqWdmA86aFvSVmn0A1wIoPZ96p4yiwbiuunA19bXH6JfjHvAnhNaQu4M Vl4B3V125Lrjpw7sYUYJxw50ZZhDLts8CkvGRu7l+ZtRahZux/ud24uVgV8srN7t/wViYrfnE tSGDvBMZB6kRJEc+MWAYL+wp5jc2W6lmmKMdhpdVgaMCgqscKKSVaQ9Qo+pgRKVyCpTSG2NqN D3L1fvmlg8xXcaSqHlhpc+svoqaE0tQLV38jLbhtlGtP70ZufQUXuH3bGLanevDdj3kCyom27 3XkReHA2H16Ovm9rukpbi/pSUhRQ9bbDDGiwNlAJrR+XCyGRUZXUI8Z5lYVpxZ7VE2gqltg5j O9i5pTUPsjRdQO2+tPKAdamXMqd1nLevAlFKgNbXBC81EcaRLTu5Zq3CFWssBY6KGdOOBdtLD LEhpxrv Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 15 Sep 2016 15:24:02 +0200 The local variable "ret" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- drivers/crypto/caam/caamhash.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index b1dbc53..adb8b19 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -440,7 +440,7 @@ static int hash_digest_key(struct caam_hash_ctx *ctx, const u8 *key_in, u32 *desc; struct split_key_result result; dma_addr_t src_dma, dst_dma; - int ret = 0; + int ret; desc = kmalloc(CAAM_CMD_SZ * 8 + CAAM_PTR_SZ * 2, GFP_KERNEL | GFP_DMA); if (!desc) { @@ -517,7 +517,7 @@ static int ahash_setkey(struct crypto_ahash *ahash, struct device *jrdev = ctx->jrdev; int blocksize = crypto_tfm_alg_blocksize(&ahash->base); int digestsize = crypto_ahash_digestsize(ahash); - int ret = 0; + int ret; u8 *hashed_key = NULL; #ifdef DEBUG @@ -975,7 +975,7 @@ static int ahash_final_ctx(struct ahash_request *req) int sec4_sg_bytes, sec4_sg_src_index; int digestsize = crypto_ahash_digestsize(ahash); struct ahash_edesc *edesc; - int ret = 0; + int ret; sec4_sg_src_index = 1 + (buflen ? 1 : 0); sec4_sg_bytes = sec4_sg_src_index * sizeof(struct sec4_sg_entry); @@ -1055,7 +1055,7 @@ static int ahash_finup_ctx(struct ahash_request *req) int src_nents, mapped_nents; int digestsize = crypto_ahash_digestsize(ahash); struct ahash_edesc *edesc; - int ret = 0; + int ret; src_nents = sg_nents_for_len(req->src, req->nbytes); if (src_nents < 0) { @@ -1139,7 +1139,7 @@ static int ahash_digest(struct ahash_request *req) int digestsize = crypto_ahash_digestsize(ahash); int src_nents, mapped_nents; struct ahash_edesc *edesc; - int ret = 0; + int ret; src_nents = sg_nents_for_len(req->src, req->nbytes); if (src_nents < 0) { @@ -1218,7 +1218,7 @@ static int ahash_final_no_ctx(struct ahash_request *req) u32 *desc; int digestsize = crypto_ahash_digestsize(ahash); struct ahash_edesc *edesc; - int ret = 0; + int ret; /* allocate space for base edesc and hw desc commands, link tables */ edesc = ahash_edesc_alloc(ctx, 0, ctx->sh_desc_digest, @@ -1408,7 +1408,7 @@ static int ahash_finup_no_ctx(struct ahash_request *req) int sec4_sg_bytes, sec4_sg_src_index, src_nents, mapped_nents; int digestsize = crypto_ahash_digestsize(ahash); struct ahash_edesc *edesc; - int ret = 0; + int ret; src_nents = sg_nents_for_len(req->src, req->nbytes); if (src_nents < 0) {