From: Jan Kiszka <jan.kis...@siemens.com>

Moving the test to the end avoids the need to initialize timerstatus.
And it also no longer confuses cppcheck 2.10.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>
---
 drivers/watchdog/ipmi_wdt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/watchdog/ipmi_wdt.c b/drivers/watchdog/ipmi_wdt.c
index f67100d..55d9623 100644
--- a/drivers/watchdog/ipmi_wdt.c
+++ b/drivers/watchdog/ipmi_wdt.c
@@ -132,7 +132,7 @@ handle_ipmi_error(UINT16 io_base)
 static EFI_STATUS
 send_ipmi_cmd(UINT16 io_base, UINT8 cmd, UINT8 *data, UINTN datalen)
 {
-       EFI_STATUS timerstatus = EFI_NOT_READY;
+       EFI_STATUS timerstatus;
        EFI_STATUS status;
 
        /*
@@ -141,13 +141,13 @@ send_ipmi_cmd(UINT16 io_base, UINT8 cmd, UINT8 *data, 
UINTN datalen)
         */
        BS->SetTimer(cmdtimer, TimerRelative, 50000000);
 
-       while (timerstatus == EFI_NOT_READY) {
+       do {
                status = _send_ipmi_cmd(io_base, cmd, data, datalen);
                if (status == EFI_SUCCESS)
                        return status;
                handle_ipmi_error(io_base);
                timerstatus = BS->CheckEvent(cmdtimer);
-       }
+       } while (timerstatus == EFI_NOT_READY);
 
        return status;
 }
-- 
2.35.3

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to efibootguard-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/efaa1d28926d1d2a1a1f0803fb83b6600dce0dbe.1697736989.git.jan.kiszka%40siemens.com.

Reply via email to