Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1575119ybe; Mon, 2 Sep 2019 23:59:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXUNqD2OjL41/ouMr15CTkw0/zP3TGyKwP6rwy741LgfjdUtdgkBzCjmh34d9Fp/GkEvnR X-Received: by 2002:a17:90a:f993:: with SMTP id cq19mr6328968pjb.51.1567493941414; Mon, 02 Sep 2019 23:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567493941; cv=none; d=google.com; s=arc-20160816; b=Z1laQuOE2kf5siXYUfuf3mqBuDqQtb/iduqqri0GHfYxj5pFrMMrYw+LJUqSBaPj7m WM75xS6VKmdvu0inE3GPasGLosB66gw10BmTCvEWmPNdX6TydPfPmXOdfMqyatPX6cbx AxjY8ZZZfdjJG1QT1dniPVMs+4UCtzKwyFzOcLZJy6olM9DnTLqqBWaKbrRJb8uij0Vo FAC5TFs9lMLpyzRhRp4Yc1Qc1lNdhDliKXp45PKmbGnmS2NU0pB3qF4GrXXfA6tDCq/q Z6by0qqyFjUflwKLew33MHgnUEoe3zav0H8C4zUfDzop2Vx96sOFt9LiEdHTV337Zg6I tPCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=h0mZZQ4gxY2IFl2Y6zokH8jj6bFLPR1bxQRr6jCG7AM=; b=Mx+ElCsiQxiDZQ13iClA+3ouSiTW8fKoNSLqQ/f4hQ6GJIsBxedtJg1TqwU3/warIi FNOV7wYqyZPmc7WpiJMhCE/UCihPz48y8OR7DZykLgxOYumjQexhWYcB5BHDH/FLre/U G/5ocrBCYeBl6A7uwJKu1sgI3zqS7fX/xf6Rj2e9ifbwKiIdt4WAV7s7vVnXzPO7x85B QrdAVaU8O4BOjeWTi8FRHrc9JL9DBcT9N2oDDK6Ky2ovtTc6nYE1ar2NmHC8GPwTNGhQ xjNKiL7ihpFSTuMYg2KITIo0s3DGUxCkkglsZH3AbEd3aKzp1tYPSVeq9Vozro/WFfzl ZuXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 123si17351536pfy.61.2019.09.02.23.58.48; Mon, 02 Sep 2019 23:59:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726557AbfICG5T (ORCPT + 99 others); Tue, 3 Sep 2019 02:57:19 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:49374 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725919AbfICG5T (ORCPT ); Tue, 3 Sep 2019 02:57:19 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 65F0365CFEEEB187FB60; Tue, 3 Sep 2019 14:57:17 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Tue, 3 Sep 2019 14:57:10 +0800 From: zhong jiang To: , , CC: , , , , Subject: [PATCH] crypto: arm64: Use PTR_ERR_OR_ZERO rather than its implementation. Date: Tue, 3 Sep 2019 14:54:16 +0800 Message-ID: <1567493656-19916-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to use it directly. hence just replace it. Signed-off-by: zhong jiang --- arch/arm64/crypto/aes-glue.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm64/crypto/aes-glue.c b/arch/arm64/crypto/aes-glue.c index ca0c84d..2a2e0a3 100644 --- a/arch/arm64/crypto/aes-glue.c +++ b/arch/arm64/crypto/aes-glue.c @@ -409,10 +409,8 @@ static int essiv_cbc_init_tfm(struct crypto_skcipher *tfm) struct crypto_aes_essiv_cbc_ctx *ctx = crypto_skcipher_ctx(tfm); ctx->hash = crypto_alloc_shash("sha256", 0, 0); - if (IS_ERR(ctx->hash)) - return PTR_ERR(ctx->hash); - return 0; + return PTR_ERR_OR_ZERO(ctx->hash); } static void essiv_cbc_exit_tfm(struct crypto_skcipher *tfm) -- 1.7.12.4