staging: rtl8188eu: Reduced nesting and improved coding style.
authorChi Pham <fempsci@gmail.com>
Tue, 18 Mar 2014 22:10:50 +0000 (23:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Mar 2014 16:10:26 +0000 (09:10 -0700)
Signed-off-by: Chi Pham <fempsci@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_cmd.c

index 016e55be33e43c71c8b2c6e34c0a64e6c0de3666..c2fb050337d505f475b29b1646bc07eebfb896bb 100644 (file)
@@ -1974,17 +1974,17 @@ static void c2h_wk_callback(struct work_struct *work)
        evtpriv->c2h_wk_alive = true;
 
        while (!rtw_cbuf_empty(evtpriv->c2h_queue)) {
-               c2h_evt = (struct c2h_evt_hdr *)rtw_cbuf_pop(evtpriv->c2h_queue);
-               if (c2h_evt != NULL) {
+               c2h_evt = (struct c2h_evt_hdr *)
+                       rtw_cbuf_pop(evtpriv->c2h_queue);
+               if (c2h_evt != NULL)
                        /* This C2H event is read, clear it */
                        c2h_evt_clear(adapter);
-               else {
+               else {
                        c2h_evt = (struct c2h_evt_hdr *)rtw_malloc(16);
-                       if (c2h_evt != NULL) {
                        /* This C2H event is not read, read & clear now */
-                               if (c2h_evt_read(adapter, (u8 *)c2h_evt) != _SUCCESS)
-                                       continue;
-                       }
+                       if (c2h_evt != NULL &&
+                           c2h_evt_read(adapter, (u8 *)c2h_evt) != _SUCCESS)
+                               continue;
                }
 
                /* Special pointer to trigger c2h_evt_clear only */