lkml.org 
[lkml]   [2018]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 1/2] staging: rtl8188eu: remove empty if statement in rtw_led.c
From
Date
On 9/6/18 12:41 PM, Joe Perches wrote:
> On Thu, 2018-09-06 at 13:32 +0300, Dan Carpenter wrote:
>> Thanks.
>>
>> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Trivial, but these case statement blocks should prefer
> unindented blocks instead of reformatting the test.
>
> Perhaps similar to the below for each of the cases:

That sounds good to me. I will send a patch with Joe's
suggestions, thanks. It will also solve some lines too
long warnings. :)

So, please do not merge this series.

> ---
> drivers/staging/rtl8188eu/core/rtw_led.c | 53 ++++++++++++++++----------------
> 1 file changed, 27 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c b/drivers/staging/rtl8188eu/core/rtw_led.c
> index cbef871a7679..d9c19c1cda16 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_led.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_led.c
> @@ -290,33 +290,34 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
> }
> break;
> case LED_CTL_SITE_SURVEY:
> - if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED))) {
> - ;
> - } else if (!pLed->bLedScanBlinkInProgress) {
> - if (IS_LED_WPS_BLINKING(pLed))
> - return;
> - if (pLed->bLedNoLinkBlinkInProgress) {
> - del_timer_sync(&pLed->BlinkTimer);
> - pLed->bLedNoLinkBlinkInProgress = false;
> - }
> - if (pLed->bLedLinkBlinkInProgress) {
> - del_timer_sync(&pLed->BlinkTimer);
> - pLed->bLedLinkBlinkInProgress = false;
> - }
> - if (pLed->bLedBlinkInProgress) {
> - del_timer_sync(&pLed->BlinkTimer);
> - pLed->bLedBlinkInProgress = false;
> - }
> - pLed->bLedScanBlinkInProgress = true;
> - pLed->CurrLedState = LED_BLINK_SCAN;
> - pLed->BlinkTimes = 24;
> - if (pLed->bLedOn)
> - pLed->BlinkingLedState = RTW_LED_OFF;
> - else
> - pLed->BlinkingLedState = RTW_LED_ON;
> - mod_timer(&pLed->BlinkTimer, jiffies +
> - msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA));
> + if (pmlmepriv->LinkDetectInfo.bBusyTraffic &&
> + check_fwstate(pmlmepriv, _FW_LINKED))
> + break;
> + if (pLed->bLedScanBlinkInProgress)
> + break;
> + if (IS_LED_WPS_BLINKING(pLed))
> + return;
> + if (pLed->bLedNoLinkBlinkInProgress) {
> + del_timer_sync(&pLed->BlinkTimer);
> + pLed->bLedNoLinkBlinkInProgress = false;
> + }
> + if (pLed->bLedLinkBlinkInProgress) {
> + del_timer_sync(&pLed->BlinkTimer);
> + pLed->bLedLinkBlinkInProgress = false;
> + }
> + if (pLed->bLedBlinkInProgress) {
> + del_timer_sync(&pLed->BlinkTimer);
> + pLed->bLedBlinkInProgress = false;
> }
> + pLed->bLedScanBlinkInProgress = true;
> + pLed->CurrLedState = LED_BLINK_SCAN;
> + pLed->BlinkTimes = 24;
> + if (pLed->bLedOn)
> + pLed->BlinkingLedState = RTW_LED_OFF;
> + else
> + pLed->BlinkingLedState = RTW_LED_ON;
> + mod_timer(&pLed->BlinkTimer, jiffies +
> + msecs_to_jiffies(LED_BLINK_SCAN_INTERVAL_ALPHA));
> break;
> case LED_CTL_TX:
> case LED_CTL_RX:
>

\
 
 \ /
  Last update: 2018-09-07 12:57    [W:0.081 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site