Skip to content

Commit

Permalink
MsWheaPkg/MsWheaEarlyStorageLib: Remove unsigned comparisons to zero
Browse files Browse the repository at this point in the history
Removes an unnecessary condition since unsigned values are always
greater than or equal to 0.

Signed-off-by: Michael Kubacki <[email protected]>
  • Loading branch information
makubacki committed Dec 12, 2023
1 parent 430d371 commit dba6e42
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ __MsWheaCMOSRawRead (

for (i = 0; i < Size; i++) {
mIndex = Offset + i;
if ((mIndex >= 0) && (mIndex <= 127)) {
if (mIndex <= 127) {
IoWrite8 (PCAT_RTC_LO_ADDRESS_PORT, mIndex);
mBuf[i] = IoRead8 (PCAT_RTC_LO_DATA_PORT);
} else {
Expand Down Expand Up @@ -114,7 +114,7 @@ __MsWheaCMOSRawWrite (

for (i = 0; i < Size; i++) {
mIndex = Offset + i;
if ((mIndex >= 0) && (mIndex <= 127)) {
if (mIndex <= 127) {
IoWrite8 (PCAT_RTC_LO_ADDRESS_PORT, mIndex);
IoWrite8 (PCAT_RTC_LO_DATA_PORT, mBuf[i]);
} else {
Expand Down Expand Up @@ -160,7 +160,7 @@ __MsWheaCMOSRawClear (

for (i = 0; i < Size; i++) {
mIndex = Offset + i;
if ((mIndex >= 0) && (mIndex <= 127)) {
if (mIndex <= 127) {
IoWrite8 (PCAT_RTC_LO_ADDRESS_PORT, mIndex);
IoWrite8 (PCAT_RTC_LO_DATA_PORT, PcdGet8 (PcdMsWheaEarlyStorageDefaultValue));
} else {
Expand Down

0 comments on commit dba6e42

Please sign in to comment.