Merge tag 'x86_urgent_for_v5.16_rc1' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / staging / wlan-ng / hfa384x_usb.c
index 8c85246..938e11a 100644 (file)
@@ -1,5 +1,5 @@
 // SPDX-License-Identifier: (GPL-2.0 OR MPL-1.1)
-/* src/prism2/driver/hfa384x_usb.c
+/*
  *
  * Functions that talk to the USB variant of the Intersil hfa384x MAC
  *
@@ -3778,18 +3778,18 @@ static void hfa384x_usb_throttlefn(struct timer_list *t)
 
        spin_lock_irqsave(&hw->ctlxq.lock, flags);
 
-       /*
-        * We need to check BOTH the RX and the TX throttle controls,
-        * so we use the bitwise OR instead of the logical OR.
-        */
        pr_debug("flags=0x%lx\n", hw->usb_flags);
-       if (!hw->wlandev->hwremoved &&
-           ((test_and_clear_bit(THROTTLE_RX, &hw->usb_flags) &&
-             !test_and_set_bit(WORK_RX_RESUME, &hw->usb_flags)) |
-            (test_and_clear_bit(THROTTLE_TX, &hw->usb_flags) &&
-             !test_and_set_bit(WORK_TX_RESUME, &hw->usb_flags))
-           )) {
-               schedule_work(&hw->usb_work);
+       if (!hw->wlandev->hwremoved) {
+               bool rx_throttle = test_and_clear_bit(THROTTLE_RX, &hw->usb_flags) &&
+                                  !test_and_set_bit(WORK_RX_RESUME, &hw->usb_flags);
+               bool tx_throttle = test_and_clear_bit(THROTTLE_TX, &hw->usb_flags) &&
+                                  !test_and_set_bit(WORK_TX_RESUME, &hw->usb_flags);
+               /*
+                * We need to check BOTH the RX and the TX throttle controls,
+                * so we use the bitwise OR instead of the logical OR.
+                */
+               if (rx_throttle | tx_throttle)
+                       schedule_work(&hw->usb_work);
        }
 
        spin_unlock_irqrestore(&hw->ctlxq.lock, flags);