All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: r8188eu: drop some stop/removed checks in the led layer
@ 2022-09-25 14:04 Martin Kaiser
  2022-09-25 14:04 ` [PATCH 1/2] staging: r8188eu: don't check bSurpriseRemoved in SwLedOff Martin Kaiser
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Martin Kaiser @ 2022-09-25 14:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

Here's two small patches that remove unnecessary checks of
bSurpriseRemoved and bDriverStopped in the led layer.

Martin Kaiser (2):
  staging: r8188eu: don't check bSurpriseRemoved in SwLedOff
  staging: r8188eu: don't check for stop/removal in the blink worker

 drivers/staging/r8188eu/core/rtw_led.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

-- 
2.30.2


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

* [PATCH 1/2] staging: r8188eu: don't check bSurpriseRemoved in SwLedOff
  2022-09-25 14:04 [PATCH 0/2] staging: r8188eu: drop some stop/removed checks in the led layer Martin Kaiser
@ 2022-09-25 14:04 ` Martin Kaiser
  2022-09-25 14:04 ` [PATCH 2/2] staging: r8188eu: don't check for stop/removal in the blink worker Martin Kaiser
  2022-09-25 21:05 ` [PATCH 0/2] staging: r8188eu: drop some stop/removed checks in the led layer Philipp Hortmann
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Kaiser @ 2022-09-25 14:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

The SwLedOff function calls rtw_read8 which in turn calls usb_read.

bSurpriseRemoved is checked in usb_read. We don't have to check it again
in SwLedOff.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/core/rtw_led.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c
index 989808a2b171..d3bd9a97efdc 100644
--- a/drivers/staging/r8188eu/core/rtw_led.c
+++ b/drivers/staging/r8188eu/core/rtw_led.c
@@ -51,7 +51,7 @@ static void SwLedOff(struct adapter *padapter, struct led_priv *pLed)
 	u8	LedCfg;
 	int res;
 
-	if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
+	if (padapter->bDriverStopped)
 		goto exit;
 
 	res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);/* 0x4E */
-- 
2.30.2


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

* [PATCH 2/2] staging: r8188eu: don't check for stop/removal in the blink worker
  2022-09-25 14:04 [PATCH 0/2] staging: r8188eu: drop some stop/removed checks in the led layer Martin Kaiser
  2022-09-25 14:04 ` [PATCH 1/2] staging: r8188eu: don't check bSurpriseRemoved in SwLedOff Martin Kaiser
@ 2022-09-25 14:04 ` Martin Kaiser
  2022-09-25 21:05 ` [PATCH 0/2] staging: r8188eu: drop some stop/removed checks in the led layer Philipp Hortmann
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Kaiser @ 2022-09-25 14:04 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel, Martin Kaiser

The blink_work function calls either SwLedOff or SwLedOn. These two
functions handle bSurpriseRemoved and bDriverStopped.

There's no need to check bSurpriseRemoved and bDriverStopped again in the
blink worker.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/core/rtw_led.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c
index d3bd9a97efdc..1e316e6358ea 100644
--- a/drivers/staging/r8188eu/core/rtw_led.c
+++ b/drivers/staging/r8188eu/core/rtw_led.c
@@ -77,9 +77,6 @@ static void blink_work(struct work_struct *work)
 	struct adapter *padapter = pLed->padapter;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-	if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
-		return;
-
 	if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) {
 		SwLedOff(padapter, pLed);
 		ResetLedStatus(pLed);
-- 
2.30.2


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

* Re: [PATCH 0/2] staging: r8188eu: drop some stop/removed checks in the led layer
  2022-09-25 14:04 [PATCH 0/2] staging: r8188eu: drop some stop/removed checks in the led layer Martin Kaiser
  2022-09-25 14:04 ` [PATCH 1/2] staging: r8188eu: don't check bSurpriseRemoved in SwLedOff Martin Kaiser
  2022-09-25 14:04 ` [PATCH 2/2] staging: r8188eu: don't check for stop/removal in the blink worker Martin Kaiser
@ 2022-09-25 21:05 ` Philipp Hortmann
  2 siblings, 0 replies; 4+ messages in thread
From: Philipp Hortmann @ 2022-09-25 21:05 UTC (permalink / raw)
  To: Martin Kaiser, Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, Pavel Skripkin,
	linux-staging, linux-kernel

On 9/25/22 16:04, Martin Kaiser wrote:
> Here's two small patches that remove unnecessary checks of
> bSurpriseRemoved and bDriverStopped in the led layer.
> 
> Martin Kaiser (2):
>    staging: r8188eu: don't check bSurpriseRemoved in SwLedOff
>    staging: r8188eu: don't check for stop/removal in the blink worker
> 
>   drivers/staging/r8188eu/core/rtw_led.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 

Quick download test is working.
Observed LED is working fine

Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150

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

end of thread, other threads:[~2022-09-25 21:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-25 14:04 [PATCH 0/2] staging: r8188eu: drop some stop/removed checks in the led layer Martin Kaiser
2022-09-25 14:04 ` [PATCH 1/2] staging: r8188eu: don't check bSurpriseRemoved in SwLedOff Martin Kaiser
2022-09-25 14:04 ` [PATCH 2/2] staging: r8188eu: don't check for stop/removal in the blink worker Martin Kaiser
2022-09-25 21:05 ` [PATCH 0/2] staging: r8188eu: drop some stop/removed checks in the led layer Philipp Hortmann

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.