staging: r8188eu: move out assignment in if condition
authorMarcelo Aloisio da Silva <marcelo.as@aol.com>
Fri, 18 Feb 2022 04:01:40 +0000 (01:01 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Feb 2022 17:10:16 +0000 (18:10 +0100)
Should not use assignment in if condition.

Signed-off-by: Marcelo Aloisio da Silva <marcelo.as@aol.com>
Link: https://lore.kernel.org/r/20220218040140.GA22796@snoopy
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_cmd.c

index 46a49f30f90019c54674e2faede4c19d93746c05..6eca30124ee8a36a920ddac3d454330d3e0770cb 100644 (file)
@@ -1318,7 +1318,8 @@ static void c2h_wk_callback(struct work_struct *work)
        evtpriv->c2h_wk_alive = true;
 
        while (!rtw_cbuf_empty(evtpriv->c2h_queue)) {
-               if ((c2h_evt = (struct c2h_evt_hdr *)rtw_cbuf_pop(evtpriv->c2h_queue)) != NULL) {
+               c2h_evt = (struct c2h_evt_hdr *)rtw_cbuf_pop(evtpriv->c2h_queue);
+               if (c2h_evt) {
                        /* This C2H event is read, clear it */
                        rtw_write8(adapter, REG_C2HEVT_CLEAR, C2H_EVT_HOST_CLOSE);
                } else {