From patchwork Wed Feb 8 13:36:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 9562569 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 D208B60216 for ; Wed, 8 Feb 2017 13:36:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C44102839C for ; Wed, 8 Feb 2017 13:36:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B92AB284C2; Wed, 8 Feb 2017 13:36:32 +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=-1.9 required=2.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A15C02839C for ; Wed, 8 Feb 2017 13:36:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cbSQ5-0007IZ-2O; Wed, 08 Feb 2017 13:36:25 +0000 Received: from www.osadl.org ([62.245.132.105]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cbSQ1-0007Ed-0S for linux-arm-kernel@lists.infradead.org; Wed, 08 Feb 2017 13:36:23 +0000 Received: from debian01.hofrr.at (92-243-34-74.adsl.nanet.at [92.243.34.74] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id v18DZQWm020709; Wed, 8 Feb 2017 14:35:27 +0100 From: Nicholas Mc Guire To: Herbert Xu Subject: [PATCH] crypto: arm/aes-ce: assign err return conditionally Date: Wed, 8 Feb 2017 14:36:19 +0100 Message-Id: <1486560979-25240-1-git-send-email-der.herr@hofr.at> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170208_053621_396501_BF57799D X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Russell King , Nicholas Mc Guire , linux-crypto@vger.kernel.org, "David S. Miller" , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As the err value is not used unless there was an error it can be assigned conditionally here. Signed-off-by: Nicholas Mc Guire --- Not sure if this is really relevant and worth changing, effectively it is practically no change as gcc would move the err = PTR_ERR(simd); below unregister_simds: anyway (based on inspection of .lst/.s files) - so it is more of an adjust C-level to object level for readability. Patch was compile-tested with multi_v7_defconfig (implies CONFIG_CRYPTO_AES_ARM_CE=m) Patch is against 4.10-rc7 (localversion-next is next-20170208) arch/arm/crypto/aes-ce-glue.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/crypto/aes-ce-glue.c b/arch/arm/crypto/aes-ce-glue.c index 883b84d..8f65030 100644 --- a/arch/arm/crypto/aes-ce-glue.c +++ b/arch/arm/crypto/aes-ce-glue.c @@ -437,9 +437,10 @@ static int __init aes_init(void) drvname = aes_algs[i].base.cra_driver_name + 2; basename = aes_algs[i].base.cra_driver_name; simd = simd_skcipher_create_compat(algname, drvname, basename); - err = PTR_ERR(simd); - if (IS_ERR(simd)) + if (IS_ERR(simd)) { + err = PTR_ERR(simd); goto unregister_simds; + } aes_simd_algs[i] = simd; }