All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: rtl8188eu: remove empty if statement in rtw_led.c
@ 2018-09-04 11:16 Michael Straube
  2018-09-04 11:16 ` [PATCH 2/2] staging: rtl8188eu: remove unnecessary parentheses " Michael Straube
  2018-09-05  8:13 ` [PATCH 1/2] staging: rtl8188eu: remove empty if statement " Dan Carpenter
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Straube @ 2018-09-04 11:16 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Remove empty if statement from 'if - else if' and replace the
else if with if. Remove the now unused variable pmlmepriv.
Also clears line over 80 characters and CamelCase checkpatch
issues.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_led.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c b/drivers/staging/rtl8188eu/core/rtw_led.c
index cbef871a7679..39904ab284fd 100644
--- a/drivers/staging/rtl8188eu/core/rtw_led.c
+++ b/drivers/staging/rtl8188eu/core/rtw_led.c
@@ -239,7 +239,6 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
 {
 	struct led_priv *ledpriv = &padapter->ledpriv;
 	struct LED_871x *pLed = &ledpriv->SwLed0;
-	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
 	switch (LedAction) {
 	case LED_CTL_POWER_ON:
@@ -290,9 +289,7 @@ 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 (!pLed->bLedScanBlinkInProgress) {
 			if (IS_LED_WPS_BLINKING(pLed))
 				return;
 			if (pLed->bLedNoLinkBlinkInProgress) {
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] staging: rtl8188eu: remove unnecessary parentheses in rtw_led.c
  2018-09-04 11:16 [PATCH 1/2] staging: rtl8188eu: remove empty if statement in rtw_led.c Michael Straube
@ 2018-09-04 11:16 ` Michael Straube
  2018-09-05  8:13 ` [PATCH 1/2] staging: rtl8188eu: remove empty if statement " Dan Carpenter
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Straube @ 2018-09-04 11:16 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Remove unnecessary parentheses from conditionals.
Also clears 'Alignment should match open parenthesis'
checkpatch issue.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_led.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c b/drivers/staging/rtl8188eu/core/rtw_led.c
index 39904ab284fd..548b21196fc9 100644
--- a/drivers/staging/rtl8188eu/core/rtw_led.c
+++ b/drivers/staging/rtl8188eu/core/rtw_led.c
@@ -18,7 +18,7 @@ static void BlinkTimerCallback(struct timer_list *t)
 	struct LED_871x *pLed = from_timer(pLed, t, BlinkTimer);
 	struct adapter *padapter = pLed->padapter;
 
-	if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
+	if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
 		return;
 
 	schedule_work(&pLed->BlinkWorkItem);
@@ -454,7 +454,7 @@ void BlinkHandler(struct LED_871x *pLed)
 {
 	struct adapter *padapter = pLed->padapter;
 
-	if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
+	if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
 		return;
 
 	SwLedBlink1(pLed);
@@ -462,8 +462,8 @@ void BlinkHandler(struct LED_871x *pLed)
 
 void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction)
 {
-	if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped) ||
-	   (!padapter->hw_init_completed))
+	if (padapter->bSurpriseRemoved || padapter->bDriverStopped ||
+	    !padapter->hw_init_completed)
 		return;
 
 	if ((padapter->pwrctrlpriv.rf_pwrstate != rf_on &&
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] staging: rtl8188eu: remove empty if statement in rtw_led.c
  2018-09-04 11:16 [PATCH 1/2] staging: rtl8188eu: remove empty if statement in rtw_led.c Michael Straube
  2018-09-04 11:16 ` [PATCH 2/2] staging: rtl8188eu: remove unnecessary parentheses " Michael Straube
@ 2018-09-05  8:13 ` Dan Carpenter
  2018-09-05 11:44   ` Michael Straube
  1 sibling, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2018-09-05  8:13 UTC (permalink / raw)
  To: Michael Straube; +Cc: gregkh, devel, linux-kernel

On Tue, Sep 04, 2018 at 01:16:15PM +0200, Michael Straube wrote:
> Remove empty if statement from 'if - else if' and replace the
> else if with if. Remove the now unused variable pmlmepriv.
> Also clears line over 80 characters and CamelCase checkpatch
> issues.
> 
> Signed-off-by: Michael Straube <straube.linux@gmail.com>
> ---
>  drivers/staging/rtl8188eu/core/rtw_led.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c b/drivers/staging/rtl8188eu/core/rtw_led.c
> index cbef871a7679..39904ab284fd 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_led.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_led.c
> @@ -239,7 +239,6 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
>  {
>  	struct led_priv *ledpriv = &padapter->ledpriv;
>  	struct LED_871x *pLed = &ledpriv->SwLed0;
> -	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
>  
>  	switch (LedAction) {
>  	case LED_CTL_POWER_ON:
> @@ -290,9 +289,7 @@ 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 (!pLed->bLedScanBlinkInProgress) {

I think you have introduced a bug...

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] staging: rtl8188eu: remove empty if statement in rtw_led.c
  2018-09-05  8:13 ` [PATCH 1/2] staging: rtl8188eu: remove empty if statement " Dan Carpenter
@ 2018-09-05 11:44   ` Michael Straube
  2018-09-05 12:10     ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Straube @ 2018-09-05 11:44 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: gregkh, devel, linux-kernel

On 9/5/18 10:13 AM, Dan Carpenter wrote:
> On Tue, Sep 04, 2018 at 01:16:15PM +0200, Michael Straube wrote:
>>
>>   	case LED_CTL_SITE_SURVEY:
>> -		if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED))) {
>> -			;
>> -		} else if (!pLed->bLedScanBlinkInProgress) {
>> +		if (!pLed->bLedScanBlinkInProgress) {
> 
> I think you have introduced a bug...

Ah yes I see now, thanks.
Would it be ok to merge the conditions in a single if?

if ((!pmlmepriv->LinkDetectInfo.bBusyTraffic ||
     !check_fwstate(pmlmepriv, _FW_LINKED)) &&
     !pLed->bLedScanBlinkInProgress) {


regards,
Michael

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] staging: rtl8188eu: remove empty if statement in rtw_led.c
  2018-09-05 11:44   ` Michael Straube
@ 2018-09-05 12:10     ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2018-09-05 12:10 UTC (permalink / raw)
  To: Michael Straube; +Cc: gregkh, devel, linux-kernel

On Wed, Sep 05, 2018 at 01:44:43PM +0200, Michael Straube wrote:
> On 9/5/18 10:13 AM, Dan Carpenter wrote:
> > On Tue, Sep 04, 2018 at 01:16:15PM +0200, Michael Straube wrote:
> > > 
> > >   	case LED_CTL_SITE_SURVEY:
> > > -		if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED))) {
> > > -			;
> > > -		} else if (!pLed->bLedScanBlinkInProgress) {
> > > +		if (!pLed->bLedScanBlinkInProgress) {
> > 
> > I think you have introduced a bug...
> 
> Ah yes I see now, thanks.
> Would it be ok to merge the conditions in a single if?
> 
> if ((!pmlmepriv->LinkDetectInfo.bBusyTraffic ||
>     !check_fwstate(pmlmepriv, _FW_LINKED)) &&
      ^
Put an extra space here because it's inside the inner parens.

>     !pLed->bLedScanBlinkInProgress) {

So it would be aligned like so:

	if ((!pmlmepriv->LinkDetectInfo.bBusyTraffic ||
	     !check_fwstate(pmlmepriv, _FW_LINKED)) &&
	    !pLed->bLedScanBlinkInProgress) {

regards,
dan capenter



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-05 12:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-04 11:16 [PATCH 1/2] staging: rtl8188eu: remove empty if statement in rtw_led.c Michael Straube
2018-09-04 11:16 ` [PATCH 2/2] staging: rtl8188eu: remove unnecessary parentheses " Michael Straube
2018-09-05  8:13 ` [PATCH 1/2] staging: rtl8188eu: remove empty if statement " Dan Carpenter
2018-09-05 11:44   ` Michael Straube
2018-09-05 12:10     ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.