Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp510719ybe; Wed, 4 Sep 2019 03:26:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGc+71QYRFgDNdN6/OlDOx8WN/bA7Q5lD4E11QvzSvtqZvlD8ONhXzqKjj5ezcxi6YFiJF X-Received: by 2002:a17:902:8484:: with SMTP id c4mr39718324plo.223.1567592765031; Wed, 04 Sep 2019 03:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567592765; cv=none; d=google.com; s=arc-20160816; b=RyX5RZ6k+HX3WNgUGiahRBAXEzIxzvgGj7yErEb6DvHvfvsiuelwL4+/QKqeFDr2Y9 YRWfE1elbIyAbPbMVaAEurlDzlto7JYBdNcza2tB2XilSpj4SM3afkhSSUm2l8zXAkVK wOVk7OPGKBT/T0tGiOf+JdyruM48r1yeaeDHXvHzw+s7cAvV4zEIkVreHGMd4yXmgQ5U 9g4j4pIvb/3AhR8hcMzZJEkxvM1O5XPlolGL+6+RBEQdIH5BtpwAHcOQ7AQ0MJGiblVp 9018PTF2D10Gq6wL2OOAACleyid6L69//GDyZiN+ou/4G5D1jVsS7eoMyYRDy37dYbNk AEGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3eZjSSpfRP7tH1omFzedgcjm9drSQbGhVHAU1ZZoasM=; b=HlFFBYuwluO9bSegXOacYTJovuAxYUAJmN5TYS2zXhBoTyugUIe78TPlDGnG6HdQd2 UHpFu/EoXUesFDkW9qty7qXdElacRZtkRng4KPBRTujonjMT0ql1rOhskhRlnWgEV4UE +Qtx9iEwiImHa6Bqj637Xji0INd6ew2cQFo6HFXSNiMhLPV5akCAx7P2RUxIXKkdJygd uxa2/+aj3B2NfKegLAPWxf//6gjXtejQYDvi1SatC0sRicMLb8SjGoLt5DoqgfmmAaGs LaDUJmnGUQCyoD15d8xX1UCrB/dI5bvFHbQQJE7lVbbtuLLUGzCDBd8f845s+diR72sG f2Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VMqQAXni; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7si2023350pjt.14.2019.09.04.03.25.42; Wed, 04 Sep 2019 03:26:05 -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; dkim=pass header.i=@kernel.org header.s=default header.b=VMqQAXni; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729268AbfIDKZb (ORCPT + 99 others); Wed, 4 Sep 2019 06:25:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:47558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725966AbfIDKZb (ORCPT ); Wed, 4 Sep 2019 06:25:31 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4C4A722CF7; Wed, 4 Sep 2019 10:25:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567592730; bh=rfWsnOUPgkutTE38JY/BCpgI9QMJXaEcBpUh9mBGwsE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VMqQAXni5qiX64ISFemaPfm08bGAYIisiGAm1Op/Lgqtv52f794fdiTk35mxlsBIX YBG+ycqI8KGSLES0FLsHoHeUPZV1IzTIs5CXG/QiJY/59vjNXX8ojNlspWdii4g4ES ++Y2pyIbS+F9W6VxkCVuVFFMR1IihiT66addx53I= Date: Wed, 4 Sep 2019 11:25:26 +0100 From: Will Deacon To: zhong jiang Cc: herbert@gondor.apana.org.au, davem@davemloft.net, catalin.marinas@arm.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] crypto: arm64: Use PTR_ERR_OR_ZERO rather than its implementation. Message-ID: <20190904102526.5vtdv5ofuezn7fre@willie-the-truck> References: <1567493656-19916-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1567493656-19916-1-git-send-email-zhongjiang@huawei.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Sep 03, 2019 at 02:54:16PM +0800, zhong jiang wrote: > 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) Acked-by: Will Deacon Assuming this will go via Herbert. Will