From: Ivan Safonov Date: Mon, 2 Nov 2015 17:16:09 +0000 (+0700) Subject: staging: rtl8188eu: do .. while (0) loop replaced by while (...) loop X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2b5a10a923e6541f20581b0557785a55e0039436;p=openwrt%2Fstaging%2Fblogic.git 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 --- 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);