summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRanbir Singh <Ranbir.Singh3@Dell.com>2023-07-17 12:24:43 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-08-02 03:13:36 +0000
commitc7c1170a4568ecc0f63e14ca6a844d40f47519a9 (patch)
tree10b2a24ad1986d234285390331e1632373358dde
parent677f2c6f1509da21258e02957b869b71b008fc61 (diff)
downloadedk2-c7c1170a4568ecc0f63e14ca6a844d40f47519a9.tar.gz
edk2-c7c1170a4568ecc0f63e14ca6a844d40f47519a9.tar.bz2
edk2-c7c1170a4568ecc0f63e14ca6a844d40f47519a9.zip
MdeModulePkg/Bus/Ata/AtaAtapiPassThru: Fix SIGN_EXTENSION Coverity issue
Line number 1348 does contain a typecast with UINT32, but it is after all the operations (16-bit left shift followed by OR'ing) are over. To avoid any SIGN_EXTENSION, typecast the intermediate result after 16-bit left shift operation immediately with UINT32. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4204 Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Ranbir Singh <Ranbir.Singh3@Dell.com> Signed-off-by: Ranbir Singh <rsingh@ventanamicro.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
-rw-r--r--MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
index 50406fe027..f39c909d06 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
@@ -1345,7 +1345,7 @@ AtaPassThruPassThru (
// Check logical block size
//
if ((IdentifyData->AtaData.phy_logic_sector_support & BIT12) != 0) {
- BlockSize = (UINT32)(((IdentifyData->AtaData.logic_sector_size_hi << 16) | IdentifyData->AtaData.logic_sector_size_lo) * sizeof (UINT16));
+ BlockSize = (UINT32)(((UINT32)(IdentifyData->AtaData.logic_sector_size_hi << 16) | IdentifyData->AtaData.logic_sector_size_lo) * sizeof (UINT16));
}
}