From 1a89d9887ff41e804610c5687e646fe30af2d7b2 Mon Sep 17 00:00:00 2001 From: Parth <56894451+parthishere@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:49:09 -0500 Subject: [PATCH] MdePkg:Update Return Error Macro in Base.h Fixing RETURN_ERROR macro. It is causing problem in Coverity Static analysis tool as we are directly converting the UINT value to INTN Changing value from UINT to INTN might cause problem. Here we know that the values would not be in loss of data. To increase the code quality and increase the static tool analysis score we have to change it Cc: Jiangang He Cc: Neo Hsueh Signed-off-by: Parth Thakkar --- MdePkg/Include/Base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 7caebbeb1f..363e0fea40 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -1058,7 +1058,7 @@ typedef UINTN RETURN_STATUS; @retval FALSE The high bit of StatusCode is clear. **/ -#define RETURN_ERROR(StatusCode) (((INTN)(RETURN_STATUS)(StatusCode)) < 0) +#define RETURN_ERROR(StatusCode) (((RETURN_STATUS)(StatusCode)) >= MAX_BIT) /// /// The operation completed successfully.