Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3970922ybg; Mon, 21 Oct 2019 01:31:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfWv0OmjoOgrPfXpj7SjkfoLeqce+GMb6pNel5VWALgsbR8KWSAdns3AFCBi0b6QhS5viQ X-Received: by 2002:a17:906:b24c:: with SMTP id ce12mr20836401ejb.327.1571646682596; Mon, 21 Oct 2019 01:31:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1571646682; cv=pass; d=google.com; s=arc-20160816; b=XqdqAzozVB5KB4cHozqmhxlPapnDAM2yfC81ld5XgeLYhz8KYniADnl0Sktb2C64b0 6PQojMW5IbQJhgBLxq3D94n8tStJ8r8FXLvVNrFB/2ats4fnTHmTl5jJWF/f7MNGQO5R g8ATEQicnown9d1DdLOVQdDWEyvIcvJZUgWlVdNksm9ZloKp2FWXVIfWphUz20gg185Y JjmrXdfAjYKOCq7rwC3SrXLlQTEgJ7IG9rshDkGT23U2XX4TL3a6RzKSPjR4kIcVGYZb Zm7cnc6dgkq3Btiu0MsUJbmL/HoNXDXX3XxP4gDGhzyEZsU8bCmMp0+do8geQm1YVL36 oTNA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=KaJyvh9DylieXzzvDNz9X/GiZZpTkM751sPrjP3pVuc=; b=l4f7xK0yUR1Y+yqUOSdtzRF6cb2iHbubOvr+NzcPKGBTDLRFS/AGt3ZZMUDGhz+pBX 7rZeZqvpfyVYpFNiG45TGvu8mBFuWGPHVcxdPltvxXDUAU3bACM9Sc7KvEn8Ue4MorgQ RjNWf9vZxQDAEjbVdawtRaUzqXIGHwsoGCFO6j8bAjsy1pfJzYUNOYu4vHlziFygqcdo WJKWN8lBbNhpXcfYYTMQ9qKOD+YRbOam01X6Y07JvEgnOlEXpC5xU4VATnYrROqxpRCW W3hiMH69rzLmTOerbjqxOBX3A7GvI82PMPUG/MHj7sgqHyP0MOjA49WMRaPkGFQmjYNy HAmg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@verimatrix.com header.s=selector2 header.b=PgdtUpmv; arc=pass (i=1 spf=pass spfdomain=verimatrix.com dkim=pass dkdomain=verimatrix.com dmarc=pass fromdomain=verimatrix.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=verimatrix.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x12si8340223ejs.203.2019.10.21.01.30.50; Mon, 21 Oct 2019 01:31:22 -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=@verimatrix.com header.s=selector2 header.b=PgdtUpmv; arc=pass (i=1 spf=pass spfdomain=verimatrix.com dkim=pass dkdomain=verimatrix.com dmarc=pass fromdomain=verimatrix.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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=verimatrix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727846AbfJUI3h (ORCPT + 99 others); Mon, 21 Oct 2019 04:29:37 -0400 Received: from mail-eopbgr790070.outbound.protection.outlook.com ([40.107.79.70]:46448 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727576AbfJUI3g (ORCPT ); Mon, 21 Oct 2019 04:29:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PjMmAsBJXFA+TRAGUnRcAe5jw6U6jlsnd+FcFOGPPJPZLHGpr0uZhvTl7Wp3VJoX6tnJ/OdJLZiEjkOuu+b1CRfCtMCYnz2WYQzoVLSmaCNdr0LSo35JHh7VVYkkYH3/3jFb2D2e3fP10J2jSIpmhLExbkm+oAhuWIsSGEu/48SRMwL8dcpNZ784AqQma++ve5NSP2czzjCJ0OQNbTnHdSlauRaxgBI1T1kq/2Q8SJ5ULxBclezK4s1RYL3hm+y72zXJ5GrWVHCS8Yi7mrvhyVBAEAn+kqm7eyT5wZNv20Q/GkpizU9xHV+4oFFELSZ1KpxcXIExRAuaaqOuTRdNjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KaJyvh9DylieXzzvDNz9X/GiZZpTkM751sPrjP3pVuc=; b=m23UeMehxqSuuQc1tEwkxoq/OlFJaZ/GUrbIwaLCCr4xj4HaSKeLy1jxJHpgUYdYpL43J3RNbBtbvak9BiFO09okXQvTXXi3/qwBx5CG6n+aK3ekhEp840Kl/aYIy5NtvSmOsUOOZY0PpBsNrjbi+RuxxwQIcpEU8HU8EgU6CsIUous/bYzvhCvQ8kflsa5E//MABWVsK+IUWGmif7kLN12/p4QUwGV0wX++64cd+ffX0Qy9d2Km2h8OAEjV6XUjFLhbbPJ81zFVPwZxCvuAP4TBw3Ts+rzybNu8zff6PE3LdPxLw+LeH/+jPQO9j+AL+HCWGeK2f/OFvj8y3XXYKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=verimatrix.com; dmarc=pass action=none header.from=verimatrix.com; dkim=pass header.d=verimatrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verimatrix.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KaJyvh9DylieXzzvDNz9X/GiZZpTkM751sPrjP3pVuc=; b=PgdtUpmvjIJmoI0d3bfi3yBK8DcB3N9HZ6mNxQsv90wJMA4+riXwsSegL3rE6puE1qSiReq7ZPR4G65UbP8UDPp3RgrdhqYuJD4bnq5uoDTRnjbBdfdHjrUHHageD5yqBuPQMNsDIvrrJshDUeePLDjBcDiRDj+bTvxPV5ADTeQ= Received: from CH2PR20MB2968.namprd20.prod.outlook.com (10.255.156.33) by CH2PR20MB3013.namprd20.prod.outlook.com (52.132.231.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.21; Mon, 21 Oct 2019 08:29:33 +0000 Received: from CH2PR20MB2968.namprd20.prod.outlook.com ([fe80::e8b0:cb5f:268e:e3ae]) by CH2PR20MB2968.namprd20.prod.outlook.com ([fe80::e8b0:cb5f:268e:e3ae%5]) with mapi id 15.20.2347.028; Mon, 21 Oct 2019 08:29:32 +0000 From: Pascal Van Leeuwen To: Tian Tao , "gilad@benyossef.com" , "herbert@gondor.apana.org.au" , "davem@davemloft.net" , "linux-crypto@vger.kernel.org" CC: "linuxarm@huawei.com" Subject: RE: [PATCH] crypto: fix safexcel_hash warning PTR_ERR_OR_ZERO can be used Thread-Topic: [PATCH] crypto: fix safexcel_hash warning PTR_ERR_OR_ZERO can be used Thread-Index: AQHVhhbVQBWlAzI6WUy2fRE/LiLWVadkxtcw Date: Mon, 21 Oct 2019 08:29:31 +0000 Message-ID: References: <1571445880-34025-1-git-send-email-tiantao6@huawei.com> In-Reply-To: <1571445880-34025-1-git-send-email-tiantao6@huawei.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=pvanleeuwen@verimatrix.com; x-originating-ip: [188.204.2.113] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 89b12d04-dbf4-47c9-5401-08d75600cc6c x-ms-traffictypediagnostic: CH2PR20MB3013: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 0197AFBD92 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(979002)(4636009)(396003)(39840400004)(376002)(136003)(346002)(366004)(13464003)(199004)(189003)(2906002)(15974865002)(110136005)(6116002)(71190400001)(66556008)(14454004)(64756008)(66446008)(6246003)(26005)(4326008)(25786009)(3846002)(76116006)(102836004)(5660300002)(186003)(6506007)(53546011)(66946007)(99286004)(52536014)(7696005)(316002)(76176011)(8936002)(71200400001)(2501003)(86362001)(229853002)(476003)(2201001)(7736002)(256004)(486006)(14444005)(66476007)(478600001)(81156014)(305945005)(74316002)(81166006)(6436002)(9686003)(8676002)(55016002)(11346002)(446003)(66066001)(33656002)(18886075002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:CH2PR20MB3013;H:CH2PR20MB2968.namprd20.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: verimatrix.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JwNDwmv9PrWN6O+pmPDk+fmnorfuDMgxezI7HlnhHbo8eB3XWKIuSUMAFj0K0GI2oeSMGQZwYPlHT/e3oHcjoiDlkt6YdQPkhI57CydXNp9U4fSFe8eH1g6tRKQ9g7hOzOUkDS1MYhYjAMV7X88LsJYu5UMAforhhmUwr4elWYnpbOcl7c1rNWVUOPbEY2MoKfG2cvgPlkIeK7IEobQV1QN/xvL76giYI1WQW38eWbuAy5KfECZL/sVnCcz4JkJ6AiInYOcrzp4oxl2aAmE5/LOex1f9wHey+w8/1aQIWJUv68lfUibCB4/hOVL7saj94WxxH3+htWasv8QbZoyT4aI+Cwiqr9/o4dHEP4SwEizx20mBxVeJFgObFlDXrN4hnjuw0FGAKoALXINhRTROdCF5iIaD4E55NuPkFQvJkeE= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: verimatrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89b12d04-dbf4-47c9-5401-08d75600cc6c X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2019 08:29:32.3875 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: dcb260f9-022d-4495-8602-eae51035a0d0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: thgKvwFTU4pivR8wD/416e7xVjHAYrUhWU+W+Wo+wRU/qdPy1cYE32KtIDV8ZFJex+tthET4HnEqJG7WZeLzn/cRgdnV9Wmued78k2Djlxw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR20MB3013 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org > -----Original Message----- > From: linux-crypto-owner@vger.kernel.org On Behalf Of > Tian Tao > Sent: Saturday, October 19, 2019 2:45 AM > To: gilad@benyossef.com; herbert@gondor.apana.org.au; davem@davemloft.net= ; linux- > crypto@vger.kernel.org > Cc: linuxarm@huawei.com > Subject: [PATCH] crypto: fix safexcel_hash warning PTR_ERR_OR_ZERO can be= used >=20 > fix below warning reported by coccicheck. > the below code is only in the crypto-dev tree currently. > drivers/crypto/inside-secure/safexcel_cipher.c:2527:1-3: WARNING: > PTR_ERR_OR_ZERO can be used. >=20 > Fixes: 38f21b4bab11 ("crypto: inside-secure - Added support for the AES X= CBC ahash") >=20 > Signed-off-by: Tian Tao > --- > drivers/crypto/inside-secure/safexcel_hash.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/drivers/crypto/inside-secure/safexcel_hash.c b/drivers/crypt= o/inside- > secure/safexcel_hash.c > index 85c3a07..3c71151 100644 > --- a/drivers/crypto/inside-secure/safexcel_hash.c > +++ b/drivers/crypto/inside-secure/safexcel_hash.c > @@ -2109,10 +2109,8 @@ static int safexcel_xcbcmac_cra_init(struct crypto= _tfm *tfm) >=20 > safexcel_ahash_cra_init(tfm); > ctx->kaes =3D crypto_alloc_cipher("aes", 0, 0); > - if (IS_ERR(ctx->kaes)) > - return PTR_ERR(ctx->kaes); >=20 > - return 0; > + return PTR_ERR_OR_ZERO(ctx->kaes); > } Thanks for spotting, but a similar patch has already been applied. So this patch is obsolete now. >=20 > static void safexcel_xcbcmac_cra_exit(struct crypto_tfm *tfm) > -- > 2.7.4 Regards, Pascal van Leeuwen Silicon IP Architect, Multi-Protocol Engines @ Verimatrix www.insidesecure.com