Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2666656ybc; Mon, 18 Nov 2019 02:47:22 -0800 (PST) X-Google-Smtp-Source: APXvYqy2jI5Mgn0YNSwhFJPb0yEcrACkSmA2oAnZB12XQsSkOSeS+3G//G1vtwmUvF3eMxnq1u9E X-Received: by 2002:a17:906:494d:: with SMTP id f13mr25934804ejt.250.1574074042322; Mon, 18 Nov 2019 02:47:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574074042; cv=none; d=google.com; s=arc-20160816; b=V39B4h4ZO7cByZU7bmZCLvTdTfQ2EnDAbGMNRObTLxLH0xPAz6CtrVBI0Y/2f328IY hoBj1V7QN4P/u7nMfWUtuNeX8X+37PoVaqy5yuzeXpZ3qCRMbaEPV9fJTzm6kRfO+bYw qf81NaXqo8vFfZ6au0ankfQyWvz0dIRbnhcdTRDP41bExxLfJFsS3QCZKfEnxgGvnUwh xCgOHcoKpxMjQBF9fBd6wAiANY60jO1f1aSujKDz1k0BCgVylCM6OV8fdoKQgNBukXFX FarRfTIMl1NJu+DE8op3JL1op4qyFoopbTsw7bVczfnRP6V6OLbhUbLvriLFfOFUzwqo /CMw== 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=NthVDfvpb4LkijrO+1OQelQLjywZUdqD7qlouJaftmw=; b=02Pszv0S2rk0FdSaN0BW4yuHSscno3NPt9IdrPsMaF5rHoVYe8VLzqf+F7adFTcFoa 99skAqMmYXg1lKYTO0jqiKw7l++6ohFhSxIR3d/scpfXIavBCGhu9LMj1AJN8CcQJQq8 2MXJNF3M7/jb6+50nO8Lv1uGMNhUIyvZwEKL5hW5Ni39wR00yqvc0PPJrejn/3SsICCe rKcj51LUb3CG0iIBSagAqY+oVpiiuQhsI0mmx/MWYxsb8GX2nhmHhoNYJ6NPMs4BQC3d rPgFBo1fweqyzOXvmAVCYuJuH0iq6YWbegxqqszqci5XMNsbnlfDgEsAyLmbG8KDZf0V lh0A== 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 m18si554590eje.437.2019.11.18.02.46.49; Mon, 18 Nov 2019 02:47:22 -0800 (PST) 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 S1726511AbfKRKqp (ORCPT + 99 others); Mon, 18 Nov 2019 05:46:45 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:40600 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726460AbfKRKqp (ORCPT ); Mon, 18 Nov 2019 05:46:45 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 39A2E5FFD6C589ED04F9; Mon, 18 Nov 2019 18:46:43 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.439.0; Mon, 18 Nov 2019 18:46:32 +0800 From: zhengbin To: , , , CC: Subject: [PATCH -next] crypto: inside-secure: Use PTR_ERR_OR_ZERO() to simplify code Date: Mon, 18 Nov 2019 18:53:56 +0800 Message-ID: <1574074436-32134-1-git-send-email-zhengbin13@huawei.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fixes coccicheck warning: drivers/crypto/inside-secure/safexcel_cipher.c:2534:1-3: WARNING: PTR_ERR_OR_ZERO can be used Reported-by: Hulk Robot Signed-off-by: zhengbin --- drivers/crypto/inside-secure/safexcel_cipher.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/crypto/inside-secure/safexcel_cipher.c b/drivers/crypto/inside-secure/safexcel_cipher.c index c029956..08cb495 100644 --- a/drivers/crypto/inside-secure/safexcel_cipher.c +++ b/drivers/crypto/inside-secure/safexcel_cipher.c @@ -2532,10 +2532,7 @@ static int safexcel_aead_gcm_cra_init(struct crypto_tfm *tfm) ctx->mode = CONTEXT_CONTROL_CRYPTO_MODE_XCM; /* override default */ ctx->hkaes = crypto_alloc_cipher("aes", 0, 0); - if (IS_ERR(ctx->hkaes)) - return PTR_ERR(ctx->hkaes); - - return 0; + return PTR_ERR_OR_ZERO(ctx->hkaes); } static void safexcel_aead_gcm_cra_exit(struct crypto_tfm *tfm) -- 2.7.4