From: Parth <56894451+parthishere@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:49:09 +0000 (-0500) Subject: MdePkg:Update Return Error Macro in Base.h X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1a89d9887f;p=people%2Faperard%2Fovmf.git 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 --- 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.