staging: r8188eu: reformat usb_write_port_complete
authorMartin Kaiser <martin@kaiser.cx>
Tue, 10 Jan 2023 20:56:24 +0000 (21:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Jan 2023 18:36:14 +0000 (19:36 +0100)
This trivial patch reformats the usb_write_port_complete function.
Hopefully, this makes the code a bit easier to read.

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/20230110205626.183516-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/os_dep/usb_ops_linux.c

index 8494b80..7da13b8 100644 (file)
@@ -38,14 +38,13 @@ void rtw_read_port_cancel(struct adapter *padapter)
 static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
 {
        struct xmit_buf *pxmitbuf = (struct xmit_buf *)purb->context;
-       struct adapter  *padapter = pxmitbuf->padapter;
-       struct xmit_priv        *pxmitpriv = &padapter->xmitpriv;
+       struct adapter *padapter = pxmitbuf->padapter;
+       struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 
        if (pxmitbuf->flags == HIGH_QUEUE_INX)
                rtw_chk_hi_queue_cmd(padapter);
 
-       if (padapter->bSurpriseRemoved || padapter->bDriverStopped ||
-           padapter->bWritePortCancel)
+       if (padapter->bSurpriseRemoved || padapter->bDriverStopped || padapter->bWritePortCancel)
                goto check_completion;
 
        switch (purb->status) {
@@ -66,13 +65,9 @@ static void usb_write_port_complete(struct urb *purb, struct pt_regs *regs)
 
 check_completion:
        rtw_sctx_done_err(&pxmitbuf->sctx,
-                         purb->status ? RTW_SCTX_DONE_WRITE_PORT_ERR :
-                         RTW_SCTX_DONE_SUCCESS);
-
+                         purb->status ? RTW_SCTX_DONE_WRITE_PORT_ERR : RTW_SCTX_DONE_SUCCESS);
        rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
-
        tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
-
 }
 
 u32 rtw_write_port(struct adapter *padapter, u32 addr, u32 cnt, u8 *wmem)