diff options
| author | Matthias Beyer <mail@beyermatthias.de> | 2014-06-23 21:18:24 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-26 21:02:13 -0400 |
| commit | ea20548a829eb0bfbca2b8743f75f67bc3be4b1c (patch) | |
| tree | ea3c915a62260085e0de4188a87048e93558fabd | |
| parent | 60654a841755e60d45cf0d7c1d52c80ac20e8e08 (diff) | |
Staging: bcm: led_control.c: Removed dead code
This patch removes the never-entered else-block inside
blink_in_normal_bandwidth(). The condition of the preceding if statement
is always true.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/bcm/led_control.c | 98 |
1 files changed, 37 insertions, 61 deletions
diff --git a/drivers/staging/bcm/led_control.c b/drivers/staging/bcm/led_control.c index 9808f536d6fb..4cf4212dd507 100644 --- a/drivers/staging/bcm/led_control.c +++ b/drivers/staging/bcm/led_control.c @@ -108,74 +108,50 @@ static INT blink_in_normal_bandwidth(struct bcm_mini_adapter *ad, enum bcm_led_events currdriverstate, ulong *timeout) { - bool bBlinkBothLED = TRUE; - /* - * Blink Tx and Rx LED when both Tx and Rx is - * in normal bandwidth + * Assign minimum number of blinks of + * either Tx or Rx. */ - if (bBlinkBothLED) { - /* - * Assign minimum number of blinks of - * either Tx or Rx. - */ - if (*num_of_time_tx > *num_of_time_rx) - *num_of_time = *num_of_time_rx; - else - *num_of_time = *num_of_time_tx; - if (*num_of_time > 0) { - /* Blink both Tx and Rx LEDs */ - if (LED_Blink(ad, 1 << GPIO_Num_tx, - uiTxLedIndex, *timeout, - *num_of_time, currdriverstate) - == EVENT_SIGNALED) - return EVENT_SIGNALED; - - if (LED_Blink(ad, 1 << GPIO_Num_rx, - uiRxLedIndex, *timeout, - *num_of_time, currdriverstate) - == EVENT_SIGNALED) - return EVENT_SIGNALED; + if (*num_of_time_tx > *num_of_time_rx) + *num_of_time = *num_of_time_rx; + else + *num_of_time = *num_of_time_tx; + if (*num_of_time > 0) { + /* Blink both Tx and Rx LEDs */ + if (LED_Blink(ad, 1 << GPIO_Num_tx, + uiTxLedIndex, *timeout, + *num_of_time, currdriverstate) + == EVENT_SIGNALED) + return EVENT_SIGNALED; - } + if (LED_Blink(ad, 1 << GPIO_Num_rx, + uiRxLedIndex, *timeout, + *num_of_time, currdriverstate) + == EVENT_SIGNALED) + return EVENT_SIGNALED; - if (*num_of_time == *num_of_time_tx) { - /* Blink pending rate of Rx */ - if (LED_Blink(ad, (1 << GPIO_Num_rx), - uiRxLedIndex, *timeout, - *num_of_time_rx - *num_of_time, - currdriverstate) - == EVENT_SIGNALED) - return EVENT_SIGNALED; + } - *num_of_time = *num_of_time_rx; - } else { - /* Blink pending rate of Tx */ - if (LED_Blink(ad, 1 << GPIO_Num_tx, - uiTxLedIndex, *timeout, - *num_of_time_tx - *num_of_time, - currdriverstate) - == EVENT_SIGNALED) - return EVENT_SIGNALED; + if (*num_of_time == *num_of_time_tx) { + /* Blink pending rate of Rx */ + if (LED_Blink(ad, (1 << GPIO_Num_rx), + uiRxLedIndex, *timeout, + *num_of_time_rx - *num_of_time, + currdriverstate) + == EVENT_SIGNALED) + return EVENT_SIGNALED; - *num_of_time = *num_of_time_tx; - } + *num_of_time = *num_of_time_rx; } else { - if (*num_of_time == *num_of_time_tx) { - /* Blink pending rate of Rx */ - if (LED_Blink(ad, 1 << GPIO_Num_tx, - uiTxLedIndex, *timeout, - *num_of_time, currdriverstate) - == EVENT_SIGNALED) - return EVENT_SIGNALED; - } else { - /* Blink pending rate of Tx */ - if (LED_Blink(ad, 1 << GPIO_Num_rx, - uiRxLedIndex, *timeout, - *num_of_time, currdriverstate) - == EVENT_SIGNALED) - return EVENT_SIGNALED; - } + /* Blink pending rate of Tx */ + if (LED_Blink(ad, 1 << GPIO_Num_tx, + uiTxLedIndex, *timeout, + *num_of_time_tx - *num_of_time, + currdriverstate) + == EVENT_SIGNALED) + return EVENT_SIGNALED; + + *num_of_time = *num_of_time_tx; } return 0; |
