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: 9562677 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 150A060434 for ; Wed, 8 Feb 2017 14:54:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0824E28502 for ; Wed, 8 Feb 2017 14:54:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0CFD28503; Wed, 8 Feb 2017 14:54:47 +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=unavailable 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 A70C0284BA for ; Wed, 8 Feb 2017 14:54:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754335AbdBHOyZ (ORCPT ); Wed, 8 Feb 2017 09:54:25 -0500 Received: from www.osadl.org ([62.245.132.105]:51449 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752923AbdBHOyD (ORCPT ); Wed, 8 Feb 2017 09:54:03 -0500 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 Cc: "David S. Miller" , Russell King , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire 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 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 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; }