diff options
author | Michael Kubacki <michael.kubacki@microsoft.com> | 2025-04-30 11:28:32 -0400 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-05-24 01:06:53 +0000 |
commit | ee6a2bfc2c9cfadc05ca0ecaaf17734521bb7aa0 (patch) | |
tree | 4cfeace7d3bba6c5b78d3029402b1e8f74f3e3a5 | |
parent | 8cb24514e2fe551bbbbddb0792550ad73a4f72d1 (diff) | |
download | edk2-ee6a2bfc2c9cfadc05ca0ecaaf17734521bb7aa0.zip edk2-ee6a2bfc2c9cfadc05ca0ecaaf17734521bb7aa0.tar.gz edk2-ee6a2bfc2c9cfadc05ca0ecaaf17734521bb7aa0.tar.bz2 |
IntelFsp2Pkg/CacheLib: Make integer width consistent in loop condition
Explicitly casts `mFixedMtrrTable[MsrNum].Length` to resolve a
`comparison-with-wider-type` CodeQL error.
https://codeql.github.com/codeql-query-help/cpp/cpp-comparison-with-wider-type/
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
-rw-r--r-- | IntelFsp2Pkg/Library/BaseCacheLib/CacheLib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/IntelFsp2Pkg/Library/BaseCacheLib/CacheLib.c b/IntelFsp2Pkg/Library/BaseCacheLib/CacheLib.c index f879c26..a708dcb 100644 --- a/IntelFsp2Pkg/Library/BaseCacheLib/CacheLib.c +++ b/IntelFsp2Pkg/Library/BaseCacheLib/CacheLib.c @@ -328,7 +328,7 @@ ProgramFixedMtrr ( return EFI_DEVICE_ERROR;
}
- for ( ; ((ByteShift < 8) && (*Len >= mFixedMtrrTable[MsrNum].Length)); ByteShift++) {
+ for ( ; ((ByteShift < 8) && (*Len >= (UINT64)mFixedMtrrTable[MsrNum].Length)); ByteShift++) {
OrMask |= LShiftU64 ((UINT64)MemoryCacheType, (UINT32)(ByteShift* 8));
ClearMask |= LShiftU64 ((UINT64)0xFF, (UINT32)(ByteShift * 8));
*Len -= mFixedMtrrTable[MsrNum].Length;
|