summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/LoongArch64/ArchExceptionHandler.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/LoongArch64/ArchExceptionHandler.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/LoongArch64/ArchExceptionHandler.c
index 94dc306a42..4f3a1b3f6d 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/LoongArch64/ArchExceptionHandler.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/LoongArch64/ArchExceptionHandler.c
@@ -267,7 +267,7 @@ IpiInterruptHandler (
//
do {
ResumeVector = IoCsrRead32 (LOONGARCH_IOCSR_MBUF0);
- } while (!ResumeVector);
+ } while (ResumeVector == 0);
//
// Get the resume vector if populated.
@@ -279,7 +279,8 @@ IpiInterruptHandler (
//
do {
Parameter = IoCsrRead32 (LOONGARCH_IOCSR_MBUF3);
- } while (!Parameter && --RereadCount);
+ --RereadCount;
+ } while ((Parameter == 0) && (RereadCount != 0));
//
// Get the parameter if populated.