Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp426608ybe; Wed, 4 Sep 2019 23:26:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHj/rU/6aEISp5q250D80wEhn7EeE331sYKYTex9ZxOYMeMpfvFKRwPapCDgbfUm9YLv6k X-Received: by 2002:a65:4304:: with SMTP id j4mr1721823pgq.419.1567664816604; Wed, 04 Sep 2019 23:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567664816; cv=none; d=google.com; s=arc-20160816; b=s5zk/eZFrj9K2/aGVBjRJLVo9z59hgOTypQdTjF347W+zT6fViZZhtG9GYDDJTIeLy o0M915JZ7pwHLF4WPN19bhWA0SXZ9pJbjKzkOBQEJd3AupiykC0+H5/Sl3pWeZyRKkE0 NS0qWHYL+uAtlT+cyhkgzN5Bq+fvZqaWaXArM9IFZC/uWsNvBXZsMGDA5vtOoleLkfeE s8KTuIKB+ye0nkiYksYIKlZpsSlFN0lt6SzCywF/daVEsNPg6AxbhP8DAAAqR/JfzwpO PuP6r3o0kHk9fKdJU/VtUsi9B9dTpWeFcx1PACCIQfi4hXlu9DuLSK0jKq/qvdFQw49u Hk6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=gImorQEwYn4I2dsi44+/Rb5lQ4sbWsWZZ9VlIuZ4kBc=; b=YC29u/X1qfwifvnwx4XcmKBhQhZ14kTRVya+R1fCpwatMfqOnh5z1sdqdi9cI71g++ HMJROr8vYrsHlmzVSHyA4oeHULl9Dt0nASPHew0tn9wSyl+4ElWMWu5FhgTc2XkB+xP9 +7TAbkSSQghJYrPws22UdOJPYx48OkvetQaCc+PcmIFH0sxdF5yfNIFAaRIuQAGlEosI ziGt/y5V5dxYj9TyBD92apayCYvN9rtnZM/oOh66BLF24j+HjYfu53X09tjF35Utsvhu xxVYDSTAi5Bak62L8naYfy6W59z2CGWqmPCFMypsrTH5hS2AHEKX5CkhlzUuVRFHmGJI 43iQ== 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 h8si1104535plt.318.2019.09.04.23.26.34; Wed, 04 Sep 2019 23:26:56 -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 S1731542AbfIEGZc (ORCPT + 99 others); Thu, 5 Sep 2019 02:25:32 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:42094 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731359AbfIEGZc (ORCPT ); Thu, 5 Sep 2019 02:25:32 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 81238E957918129EA04E; Thu, 5 Sep 2019 14:25:30 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.439.0; Thu, 5 Sep 2019 14:25:28 +0800 Message-ID: <5D70AA57.5080700@huawei.com> Date: Thu, 5 Sep 2019 14:25:27 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Will Deacon , CC: , , , , Subject: Re: [PATCH] crypto: arm64: Use PTR_ERR_OR_ZERO rather than its implementation. References: <1567493656-19916-1-git-send-email-zhongjiang@huawei.com> <20190904102526.5vtdv5ofuezn7fre@willie-the-truck> In-Reply-To: <20190904102526.5vtdv5ofuezn7fre@willie-the-truck> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2019/9/4 18:25, Will Deacon wrote: > 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 Thanks. Sincerely, zhong jiang > Assuming this will go via Herbert. > > Will > > . >