]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Staging: bcm: led_control.c: Simplified nested if conditions
authorMatthias Beyer <mail@beyermatthias.de>
Mon, 23 Jun 2014 19:18:20 +0000 (21:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2014 01:02:13 +0000 (21:02 -0400)
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/bcm/led_control.c

index 612e61e46752916b62c7ff69f4067f7936ebffce..f528a455ab8f1b8a68d06628e29684540f557d82 100644 (file)
@@ -632,31 +632,29 @@ static INT BcmGetGPIOPinInfo(struct bcm_mini_adapter *Adapter,
 
        for (uiIndex = 0; uiIndex < NUM_OF_LEDS; uiIndex++) {
 
-               if ((currdriverstate == NORMAL_OPERATION) ||
-                               (currdriverstate == IDLEMODE_EXIT) ||
-                               (currdriverstate == FW_DOWNLOAD)) {
-                       if (Adapter->LEDInfo.LEDState[uiIndex].LED_Blink_State &
-                                       currdriverstate) {
-                               if (Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num
-                                               != DISABLE_GPIO_NUM) {
-                                       if (*GPIO_num_tx == DISABLE_GPIO_NUM) {
-                                               *GPIO_num_tx = Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num;
-                                               *uiLedTxIndex = uiIndex;
-                                       } else {
-                                               *GPIO_num_rx = Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num;
-                                               *uiLedRxIndex = uiIndex;
-                                       }
-                               }
-                       }
-               } else {
-                       if (Adapter->LEDInfo.LEDState[uiIndex].LED_On_State
-                                       & currdriverstate) {
-                               if (Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num
-                                               != DISABLE_GPIO_NUM) {
+               if (((currdriverstate == NORMAL_OPERATION) ||
+                       (currdriverstate == IDLEMODE_EXIT) ||
+                       (currdriverstate == FW_DOWNLOAD)) &&
+                   (Adapter->LEDInfo.LEDState[uiIndex].LED_Blink_State &
+                                       currdriverstate)) {
+                       if (Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num
+                                       != DISABLE_GPIO_NUM) {
+                               if (*GPIO_num_tx == DISABLE_GPIO_NUM) {
                                        *GPIO_num_tx = Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num;
                                        *uiLedTxIndex = uiIndex;
+                               } else {
+                                       *GPIO_num_rx = Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num;
+                                       *uiLedRxIndex = uiIndex;
                                }
                        }
+               } else {
+                       if ((Adapter->LEDInfo.LEDState[uiIndex].LED_On_State &
+                                               currdriverstate) &&
+                           (Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num !=
+                            DISABLE_GPIO_NUM)) {
+                               *GPIO_num_tx = Adapter->LEDInfo.LEDState[uiIndex].GPIO_Num;
+                               *uiLedTxIndex = uiIndex;
+                       }
                }
        }
        return STATUS_SUCCESS;