staging: rtl8188eu: 'infinite' loop removed
authorIvan Safonov <insafonov@gmail.com>
Mon, 2 Nov 2015 17:16:53 +0000 (00:16 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Nov 2015 04:02:47 +0000 (20:02 -0800)
The body of this loop is executed only once, so it can be removed.
In this loop no keyword 'continue', only 'break' at the end.

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

index 7c5086ecff1704ca4838113c33f35930774c5177..e04303ce80af8ee8979d8878ce93aabc5d23d0b1 100644 (file)
@@ -463,30 +463,26 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
        }
 
        /* 3 1. pick up first frame */
-       do {
-               rtw_free_xmitframe(pxmitpriv, pxmitframe);
-
-               pxmitframe = rtw_dequeue_xframe(pxmitpriv, pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
-               if (pxmitframe == NULL) {
-                       /*  no more xmit frame, release xmit buffer */
-                       rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
-                       return false;
-               }
+       rtw_free_xmitframe(pxmitpriv, pxmitframe);
 
-               pxmitframe->pxmitbuf = pxmitbuf;
-               pxmitframe->buf_addr = pxmitbuf->pbuf;
-               pxmitbuf->priv_data = pxmitframe;
+       pxmitframe = rtw_dequeue_xframe(pxmitpriv, pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
+       if (pxmitframe == NULL) {
+               /*  no more xmit frame, release xmit buffer */
+               rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
+               return false;
+       }
 
-               pxmitframe->agg_num = 1; /*  alloc xmitframe should assign to 1. */
-               pxmitframe->pkt_offset = 1; /*  first frame of aggregation, reserve offset */
+       pxmitframe->pxmitbuf = pxmitbuf;
+       pxmitframe->buf_addr = pxmitbuf->pbuf;
+       pxmitbuf->priv_data = pxmitframe;
 
-               rtw_xmitframe_coalesce(adapt, pxmitframe->pkt, pxmitframe);
+       pxmitframe->agg_num = 1; /*  alloc xmitframe should assign to 1. */
+       pxmitframe->pkt_offset = 1; /*  first frame of aggregation, reserve offset */
 
-               /*  always return ndis_packet after rtw_xmitframe_coalesce */
-               rtw_os_xmit_complete(adapt, pxmitframe);
+       rtw_xmitframe_coalesce(adapt, pxmitframe->pkt, pxmitframe);
 
-               break;
-       } while (1);
+       /*  always return ndis_packet after rtw_xmitframe_coalesce */
+       rtw_os_xmit_complete(adapt, pxmitframe);
 
        /* 3 2. aggregate same priority and same DA(AP or STA) frames */
        pfirstframe = pxmitframe;