From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.43.1608139345570532699 for ; Wed, 16 Dec 2020 09:22:25 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3B16B1FB; Wed, 16 Dec 2020 09:22:25 -0800 (PST) Received: from e120189.arm.com (unknown [10.57.25.48]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 18DFA3F66E; Wed, 16 Dec 2020 09:22:23 -0800 (PST) From: "PierreGondois" To: devel@edk2.groups.io, ard.biesheuvel@arm.com, leif@nuviainc.com Cc: sami.mujawar@arm.com Subject: [PATCH v1 03/25] ArmPkg: Fix Ecc error 3002 in OpteeLib Date: Wed, 16 Dec 2020 17:21:38 +0000 Message-Id: <20201216172200.25846-4-Pierre.Gondois@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201216172200.25846-1-Pierre.Gondois@arm.com> References: <20201216172200.25846-1-Pierre.Gondois@arm.com> From: Pierre Gondois This patch fixes the following Ecc reported error: Non-Boolean comparisons should use a compare operator (==, !=, >, < >=, <=) Signed-off-by: Pierre Gondois --- The changes can be seen at: https://github.com/PierreARM/edk2/commits/1552_Ecc_ArmPkg_v1 ArmPkg/Library/OpteeLib/Optee.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ArmPkg/Library/OpteeLib/Optee.c b/ArmPkg/Library/OpteeLib/Optee.c index 2562bc093b61..e763228e9cd3 100644 --- a/ArmPkg/Library/OpteeLib/Optee.c +++ b/ArmPkg/Library/OpteeLib/Optee.c @@ -3,6 +3,7 @@ secure monitor calls. Copyright (c) 2018, Linaro Ltd. All rights reserved.
+ Copyright (c) 2020, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -227,7 +228,7 @@ OpteeOpenSession ( MessageArg->NumParams = 2; - if (OpteeCallWithArg ((UINTN)MessageArg)) { + if (OpteeCallWithArg ((UINTN)MessageArg) != 0) { MessageArg->Return = OPTEE_ERROR_COMMUNICATION; MessageArg->ReturnOrigin = OPTEE_ORIGIN_COMMUNICATION; } @@ -431,7 +432,7 @@ OpteeInvokeFunction ( MessageArg->NumParams = OPTEE_MAX_CALL_PARAMS; - if (OpteeCallWithArg ((UINTN)MessageArg)) { + if (OpteeCallWithArg ((UINTN)MessageArg) != 0) { MessageArg->Return = OPTEE_ERROR_COMMUNICATION; MessageArg->ReturnOrigin = OPTEE_ORIGIN_COMMUNICATION; } @@ -440,7 +441,7 @@ OpteeInvokeFunction ( InvokeFunctionArg->Params, OPTEE_MAX_CALL_PARAMS, MessageArg->Params - )) { + ) != 0) { MessageArg->Return = OPTEE_ERROR_COMMUNICATION; MessageArg->ReturnOrigin = OPTEE_ORIGIN_COMMUNICATION; } -- 2.17.1