From 2b5a10a923e6541f20581b0557785a55e0039436 Mon Sep 17 00:00:00 2001 From: Ivan Safonov Date: Tue, 3 Nov 2015 00:16:09 +0700 Subject: [PATCH] staging: rtl8188eu: do .. while (0) loop replaced by while (...) loop It is a simple and clear representation of this loop. Signed-off-by: Ivan Safonov Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 9b7026e7d55b..f0ac66de34d6 100644 --- a/drivers/staging/rtl8188eu/core/rtw_cmd.c +++ b/drivers/staging/rtl8188eu/core/rtw_cmd.c @@ -242,15 +242,11 @@ post_process: pcmdpriv->cmdthd_running = false; /* free all cmd_obj resources */ - do { - pcmd = rtw_dequeue_cmd(&pcmdpriv->cmd_queue); - if (pcmd == NULL) - break; - + while ((pcmd = rtw_dequeue_cmd(&pcmdpriv->cmd_queue))) { /* DBG_88E("%s: leaving... drop cmdcode:%u\n", __func__, pcmd->cmdcode); */ rtw_free_cmd_obj(pcmd); - } while (1); + } up(&pcmdpriv->terminate_cmdthread_sema); -- 2.30.2