staging: r8188eu: simplify rtl8188eu_xmit_tasklet
authorMartin Kaiser <martin@kaiser.cx>
Fri, 30 Dec 2022 18:06:32 +0000 (19:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Jan 2023 18:31:22 +0000 (19:31 +0100)
Simplify the rtl8188eu_xmit_tasklet function. Remove an unnecessary
temporary variable and reformat the code.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150
Link: https://lore.kernel.org/r/20221230180646.91008-7-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/usb_ops_linux.c

index c51f860d35278a485bc78b3750a30aca43ee4e0b..a238d29a3a46ff8813480aa5719c46e9658f33fd 100644 (file)
@@ -481,22 +481,14 @@ u32 rtw_read_port(struct adapter *adapter, u8 *rmem)
 
 void rtl8188eu_xmit_tasklet(unsigned long priv)
 {
-       int ret = false;
        struct adapter *adapt = (struct adapter *)priv;
        struct xmit_priv *pxmitpriv = &adapt->xmitpriv;
 
        if (check_fwstate(&adapt->mlmepriv, _FW_UNDER_SURVEY))
                return;
 
-       while (1) {
-               if ((adapt->bDriverStopped) ||
-                   (adapt->bSurpriseRemoved) ||
-                   (adapt->bWritePortCancel))
-                       break;
-
-               ret = rtl8188eu_xmitframe_complete(adapt, pxmitpriv);
-
-               if (!ret)
+       do {
+               if (adapt->bDriverStopped || adapt->bSurpriseRemoved || adapt->bWritePortCancel)
                        break;
-       }
+       } while (rtl8188eu_xmitframe_complete(adapt, pxmitpriv));
 }