staging: rtl8188eu: do .. while (0) loop replaced by while (...) loop
authorIvan Safonov <insafonov@gmail.com>
Mon, 2 Nov 2015 17:16:09 +0000 (00:16 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Nov 2015 04:02:47 +0000 (20:02 -0800)
It is a simple and clear representation of this loop.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_cmd.c

index 9b7026e7d55b654cf3861a10d0420341eb7846f1..f0ac66de34d67c08a00bf2e5b8875eedce9aa5a6 100644 (file)
@@ -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);