linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] staging: r8188eu: another round of removals
@ 2022-02-26 14:48 Martin Kaiser
  2022-02-26 14:48 ` [PATCH 1/6] staging: r8188eu: smooth_rssi_data is not used Martin Kaiser
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 14:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

This set removes some unused variables, functions and defines in
rtw_recv.[ch]

Martin Kaiser (6):
  staging: r8188eu: smooth_rssi_data is not used
  staging: r8188eu: irq_prepare_beacon_tasklet is unused
  staging: r8188eu: cnt is set but not used
  staging: r8188eu: recvframe_push is not used
  staging: r8188eu: get_rx_status is not used
  staging: r8188eu: remove unused define

 drivers/staging/r8188eu/core/rtw_recv.c    |  2 --
 drivers/staging/r8188eu/include/rtw_recv.h | 34 ----------------------
 2 files changed, 36 deletions(-)

-- 
2.30.2


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

* [PATCH 1/6] staging: r8188eu: smooth_rssi_data is not used
  2022-02-26 14:48 [PATCH 0/6] staging: r8188eu: another round of removals Martin Kaiser
@ 2022-02-26 14:48 ` Martin Kaiser
  2022-02-26 14:48 ` [PATCH 2/6] staging: r8188eu: irq_prepare_beacon_tasklet is unused Martin Kaiser
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 14:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

struct smooth_rssi_data is not used in this driver.
It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_recv.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h
index 5e65cf6b87bc..13df95781747 100644
--- a/drivers/staging/r8188eu/include/rtw_recv.h
+++ b/drivers/staging/r8188eu/include/rtw_recv.h
@@ -55,13 +55,6 @@ struct	stainfo_rxcache	{
 */
 };
 
-struct smooth_rssi_data {
-	u32	elements[100];	/* array to store values */
-	u32	index;			/* index to current array to store */
-	u32	total_num;		/* num of valid elements */
-	u32	total_val;		/* sum of valid elements */
-};
-
 struct signal_stat {
 	u8	update_req;		/* used to indicate */
 	u8	avg_val;		/* avg of valid elements */
-- 
2.30.2


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

* [PATCH 2/6] staging: r8188eu: irq_prepare_beacon_tasklet is unused
  2022-02-26 14:48 [PATCH 0/6] staging: r8188eu: another round of removals Martin Kaiser
  2022-02-26 14:48 ` [PATCH 1/6] staging: r8188eu: smooth_rssi_data is not used Martin Kaiser
@ 2022-02-26 14:48 ` Martin Kaiser
  2022-02-26 14:48 ` [PATCH 3/6] staging: r8188eu: cnt is set but not used Martin Kaiser
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 14:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

irq_prepare_beacon_tasklet in struct recv_priv is not used for r8188eu.
Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_recv.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h
index 13df95781747..a417a70835e7 100644
--- a/drivers/staging/r8188eu/include/rtw_recv.h
+++ b/drivers/staging/r8188eu/include/rtw_recv.h
@@ -170,7 +170,6 @@ struct recv_priv {
 	struct semaphore allrxreturnevt;
 	u8	rx_pending_cnt;
 
-	struct tasklet_struct irq_prepare_beacon_tasklet;
 	struct tasklet_struct recv_tasklet;
 	struct sk_buff_head free_recv_skb_queue;
 	struct sk_buff_head rx_skb_queue;
-- 
2.30.2


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

* [PATCH 3/6] staging: r8188eu: cnt is set but not used
  2022-02-26 14:48 [PATCH 0/6] staging: r8188eu: another round of removals Martin Kaiser
  2022-02-26 14:48 ` [PATCH 1/6] staging: r8188eu: smooth_rssi_data is not used Martin Kaiser
  2022-02-26 14:48 ` [PATCH 2/6] staging: r8188eu: irq_prepare_beacon_tasklet is unused Martin Kaiser
@ 2022-02-26 14:48 ` Martin Kaiser
  2022-02-26 16:57   ` Pavel Skripkin
  2022-02-26 14:48 ` [PATCH 4/6] staging: r8188eu: recvframe_push is " Martin Kaiser
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 14:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

In function recv_func, the cnt variable is set but not used.
It can be removed.

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

diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index 0144c4642911..9a2e2bc2e294 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -1798,11 +1798,9 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe)
 	if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
 	    psecuritypriv->busetkipkey) {
 		struct recv_frame *pending_frame;
-		int cnt = 0;
 
 		pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue);
 		while (pending_frame) {
-			cnt++;
 			recv_func_posthandle(padapter, pending_frame);
 		}
 	}
-- 
2.30.2


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

* [PATCH 4/6] staging: r8188eu: recvframe_push is not used
  2022-02-26 14:48 [PATCH 0/6] staging: r8188eu: another round of removals Martin Kaiser
                   ` (2 preceding siblings ...)
  2022-02-26 14:48 ` [PATCH 3/6] staging: r8188eu: cnt is set but not used Martin Kaiser
@ 2022-02-26 14:48 ` Martin Kaiser
  2022-02-26 14:48 ` [PATCH 5/6] staging: r8188eu: get_rx_status " Martin Kaiser
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 14:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

The recvframe_push function is not used. It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_recv.h | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h
index a417a70835e7..25afcbe862e6 100644
--- a/drivers/staging/r8188eu/include/rtw_recv.h
+++ b/drivers/staging/r8188eu/include/rtw_recv.h
@@ -286,26 +286,6 @@ static inline u8 *get_rx_status(struct recv_frame *precvframe)
 	return get_rxmem(precvframe);
 }
 
-static inline u8 *recvframe_push(struct recv_frame *precvframe, int sz)
-{
-	/*  append data before rx_data */
-
-	/* add data to the start of recv_frame
- *
- *      This function extends the used data area of the recv_frame at the buffer
- *      start. rx_data must be still larger than rx_head, after pushing.
- */
-	if (precvframe == NULL)
-		return NULL;
-	precvframe->rx_data -= sz ;
-	if (precvframe->rx_data < precvframe->rx_head) {
-		precvframe->rx_data += sz;
-		return NULL;
-	}
-	precvframe->len += sz;
-	return precvframe->rx_data;
-}
-
 static inline u8 *recvframe_pull(struct recv_frame *precvframe, int sz)
 {
 	/*  rx_data += sz; move rx_data sz bytes  hereafter */
-- 
2.30.2


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

* [PATCH 5/6] staging: r8188eu: get_rx_status is not used
  2022-02-26 14:48 [PATCH 0/6] staging: r8188eu: another round of removals Martin Kaiser
                   ` (3 preceding siblings ...)
  2022-02-26 14:48 ` [PATCH 4/6] staging: r8188eu: recvframe_push is " Martin Kaiser
@ 2022-02-26 14:48 ` Martin Kaiser
  2022-02-26 14:48 ` [PATCH 6/6] staging: r8188eu: remove unused define Martin Kaiser
  2022-02-26 18:14 ` [PATCH v2 0/7] staging: r8188eu: some removals, fix an endless loop Martin Kaiser
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 14:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Remove the unused function get_rx_status.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_recv.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h
index 25afcbe862e6..d2c1efbe62f0 100644
--- a/drivers/staging/r8188eu/include/rtw_recv.h
+++ b/drivers/staging/r8188eu/include/rtw_recv.h
@@ -281,11 +281,6 @@ static inline u8 *get_rxmem(struct recv_frame *precvframe)
 	return precvframe->rx_head;
 }
 
-static inline u8 *get_rx_status(struct recv_frame *precvframe)
-{
-	return get_rxmem(precvframe);
-}
-
 static inline u8 *recvframe_pull(struct recv_frame *precvframe, int sz)
 {
 	/*  rx_data += sz; move rx_data sz bytes  hereafter */
-- 
2.30.2


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

* [PATCH 6/6] staging: r8188eu: remove unused define
  2022-02-26 14:48 [PATCH 0/6] staging: r8188eu: another round of removals Martin Kaiser
                   ` (4 preceding siblings ...)
  2022-02-26 14:48 ` [PATCH 5/6] staging: r8188eu: get_rx_status " Martin Kaiser
@ 2022-02-26 14:48 ` Martin Kaiser
  2022-02-26 18:14 ` [PATCH v2 0/7] staging: r8188eu: some removals, fix an endless loop Martin Kaiser
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 14:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Remove the rtw_dequeue_recvframe define, which is not used.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_recv.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h
index d2c1efbe62f0..6a6f6373467b 100644
--- a/drivers/staging/r8188eu/include/rtw_recv.h
+++ b/drivers/staging/r8188eu/include/rtw_recv.h
@@ -264,7 +264,6 @@ struct recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue);
 struct recv_frame *rtw_alloc_recvframe(struct __queue *pfree_recv_queue);
 int  rtw_free_recvframe(struct recv_frame *precvframe,
 			struct __queue *pfree_recv_queue);
-#define rtw_dequeue_recvframe(queue) rtw_alloc_recvframe(queue)
 int _rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue);
 int rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue);
 void rtw_free_recvframe_queue(struct __queue *pframequeue,
-- 
2.30.2


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

* Re: [PATCH 3/6] staging: r8188eu: cnt is set but not used
  2022-02-26 14:48 ` [PATCH 3/6] staging: r8188eu: cnt is set but not used Martin Kaiser
@ 2022-02-26 16:57   ` Pavel Skripkin
  2022-02-26 17:32     ` Pavel Skripkin
  2022-02-26 17:59     ` Martin Kaiser
  0 siblings, 2 replies; 20+ messages in thread
From: Pavel Skripkin @ 2022-02-26 16:57 UTC (permalink / raw)
  To: Martin Kaiser, Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel

Hi Martin,

On 2/26/22 17:48, Martin Kaiser wrote:
> In function recv_func, the cnt variable is set but not used.
> It can be removed.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>   drivers/staging/r8188eu/core/rtw_recv.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
> index 0144c4642911..9a2e2bc2e294 100644
> --- a/drivers/staging/r8188eu/core/rtw_recv.c
> +++ b/drivers/staging/r8188eu/core/rtw_recv.c
> @@ -1798,11 +1798,9 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe)
>   	if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
>   	    psecuritypriv->busetkipkey) {
>   		struct recv_frame *pending_frame;
> -		int cnt = 0;
>   
>   		pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue);
>   		while (pending_frame) {

Just out of curiosity: is this thing infinity loop?

> -			cnt++;
>   			recv_func_posthandle(padapter, pending_frame);
>   		}

Nit: bracers can be removed

>   	}




With regards,
Pavel Skripkin

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

* Re: [PATCH 3/6] staging: r8188eu: cnt is set but not used
  2022-02-26 16:57   ` Pavel Skripkin
@ 2022-02-26 17:32     ` Pavel Skripkin
  2022-02-26 18:07       ` Martin Kaiser
  2022-02-26 17:59     ` Martin Kaiser
  1 sibling, 1 reply; 20+ messages in thread
From: Pavel Skripkin @ 2022-02-26 17:32 UTC (permalink / raw)
  To: Martin Kaiser, Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel

On 2/26/22 19:57, Pavel Skripkin wrote:
> Hi Martin,
> 
> On 2/26/22 17:48, Martin Kaiser wrote:
>> In function recv_func, the cnt variable is set but not used.
>> It can be removed.
>> 
>> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
>> ---
>>   drivers/staging/r8188eu/core/rtw_recv.c | 2 --
>>   1 file changed, 2 deletions(-)
>> 
>> diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
>> index 0144c4642911..9a2e2bc2e294 100644
>> --- a/drivers/staging/r8188eu/core/rtw_recv.c
>> +++ b/drivers/staging/r8188eu/core/rtw_recv.c
>> @@ -1798,11 +1798,9 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe)
>>   	if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
>>   	    psecuritypriv->busetkipkey) {
>>   		struct recv_frame *pending_frame;
>> -		int cnt = 0;
>>   
>>   		pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue);
>>   		while (pending_frame) {
> 
> Just out of curiosity: is this thing infinity loop?
> 

Hm.

This function is called only inside a tasklet. IIRC it's not ok to have 
this kind of loops in softirq context




With regards,
Pavel Skripkin

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

* Re: [PATCH 3/6] staging: r8188eu: cnt is set but not used
  2022-02-26 16:57   ` Pavel Skripkin
  2022-02-26 17:32     ` Pavel Skripkin
@ 2022-02-26 17:59     ` Martin Kaiser
  1 sibling, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 17:59 UTC (permalink / raw)
  To: Pavel Skripkin
  Cc: Greg Kroah-Hartman, Larry Finger, Phillip Potter,
	Michael Straube, linux-staging, linux-kernel

Hi Pavel,

Thus wrote Pavel Skripkin (paskripkin@gmail.com):

> Hi Martin,

> On 2/26/22 17:48, Martin Kaiser wrote:
> > In function recv_func, the cnt variable is set but not used.
> > It can be removed.

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

> > diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
> > index 0144c4642911..9a2e2bc2e294 100644
> > --- a/drivers/staging/r8188eu/core/rtw_recv.c
> > +++ b/drivers/staging/r8188eu/core/rtw_recv.c
> > @@ -1798,11 +1798,9 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe)
> >   	if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
> >   	    psecuritypriv->busetkipkey) {
> >   		struct recv_frame *pending_frame;
> > -		int cnt = 0;
> >   		pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue);
> >   		while (pending_frame) {

> Just out of curiosity: is this thing infinity loop?

yes it is. And the issue has been present since the driver was first
merged. Let's fix this before removing cnt so that the fix can be
backported to stable. I'll send out v2 shortly.

Thanks,
Martin

> > -			cnt++;
> >   			recv_func_posthandle(padapter, pending_frame);
> >   		}

> Nit: bracers can be removed

> >   	}




> With regards,
> Pavel Skripkin

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

* Re: [PATCH 3/6] staging: r8188eu: cnt is set but not used
  2022-02-26 17:32     ` Pavel Skripkin
@ 2022-02-26 18:07       ` Martin Kaiser
  2022-02-26 18:09         ` Pavel Skripkin
  0 siblings, 1 reply; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 18:07 UTC (permalink / raw)
  To: Pavel Skripkin
  Cc: Greg Kroah-Hartman, Larry Finger, Phillip Potter,
	Michael Straube, linux-staging, linux-kernel

Thus wrote Pavel Skripkin (paskripkin@gmail.com):

> On 2/26/22 19:57, Pavel Skripkin wrote:
> > Hi Martin,

> > On 2/26/22 17:48, Martin Kaiser wrote:
> > > In function recv_func, the cnt variable is set but not used.
> > > It can be removed.

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

> > > diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
> > > index 0144c4642911..9a2e2bc2e294 100644
> > > --- a/drivers/staging/r8188eu/core/rtw_recv.c
> > > +++ b/drivers/staging/r8188eu/core/rtw_recv.c
> > > @@ -1798,11 +1798,9 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe)
> > >   	if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
> > >   	    psecuritypriv->busetkipkey) {
> > >   		struct recv_frame *pending_frame;
> > > -		int cnt = 0;
> > >   		pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue);
> > >   		while (pending_frame) {

> > Just out of curiosity: is this thing infinity loop?


> Hm.

> This function is called only inside a tasklet. IIRC it's not ok to have this
> kind of loops in softirq context

What exactly is this doing that's not allowed in a tasklet? Does it call
anything that could potentially block? 

If I pull rtw_alloc_recvframe into the loop, that function uses spin_lock_bh +
spin_unlock_bh, I guess this is ok. As for recv_func_posthandle, I don't
see anything where we could be stuck...

Thanks,
Martin

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

* Re: [PATCH 3/6] staging: r8188eu: cnt is set but not used
  2022-02-26 18:07       ` Martin Kaiser
@ 2022-02-26 18:09         ` Pavel Skripkin
  0 siblings, 0 replies; 20+ messages in thread
From: Pavel Skripkin @ 2022-02-26 18:09 UTC (permalink / raw)
  To: Martin Kaiser
  Cc: Greg Kroah-Hartman, Larry Finger, Phillip Potter,
	Michael Straube, linux-staging, linux-kernel

Hi Martin,

On 2/26/22 21:07, Martin Kaiser wrote:
> What exactly is this doing that's not allowed in a tasklet? Does it call
> anything that could potentially block?
> 

I mean infinity loop :)

> If I pull rtw_alloc_recvframe into the loop, that function uses spin_lock_bh +
> spin_unlock_bh, I guess this is ok. As for recv_func_posthandle, I don't
> see anything where we could be stuck...
> 

Yeah, I guess, it's how it meant to be (like in 
rtw_free_uc_swdec_pending_queue())




With regards,
Pavel Skripkin

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

* [PATCH v2 0/7] staging: r8188eu: some removals, fix an endless loop
  2022-02-26 14:48 [PATCH 0/6] staging: r8188eu: another round of removals Martin Kaiser
                   ` (5 preceding siblings ...)
  2022-02-26 14:48 ` [PATCH 6/6] staging: r8188eu: remove unused define Martin Kaiser
@ 2022-02-26 18:14 ` Martin Kaiser
  2022-02-26 18:14   ` [PATCH v2 1/7] staging: r8188eu: smooth_rssi_data is not used Martin Kaiser
                     ` (6 more replies)
  6 siblings, 7 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 18:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Pavel Skripkin, Martin Kaiser

This set removes some unused variables, functions and defines in
rtw_recv.[ch]

v2: Fix an endless loop in recv_func.

Martin Kaiser (7):
  staging: r8188eu: smooth_rssi_data is not used
  staging: r8188eu: irq_prepare_beacon_tasklet is unused
  staging: r8188eu: fix endless loop in recv_func
  staging: r8188eu: cnt is set but not used
  staging: r8188eu: recvframe_push is not used
  staging: r8188eu: get_rx_status is not used
  staging: r8188eu: remove unused define

 drivers/staging/r8188eu/core/rtw_recv.c    |  6 +---
 drivers/staging/r8188eu/include/rtw_recv.h | 34 ----------------------
 2 files changed, 1 insertion(+), 39 deletions(-)

-- 
2.30.2


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

* [PATCH v2 1/7] staging: r8188eu: smooth_rssi_data is not used
  2022-02-26 18:14 ` [PATCH v2 0/7] staging: r8188eu: some removals, fix an endless loop Martin Kaiser
@ 2022-02-26 18:14   ` Martin Kaiser
  2022-02-26 18:14   ` [PATCH v2 2/7] staging: r8188eu: irq_prepare_beacon_tasklet is unused Martin Kaiser
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 18:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Pavel Skripkin, Martin Kaiser

struct smooth_rssi_data is not used in this driver.
It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_recv.h | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h
index 5e65cf6b87bc..13df95781747 100644
--- a/drivers/staging/r8188eu/include/rtw_recv.h
+++ b/drivers/staging/r8188eu/include/rtw_recv.h
@@ -55,13 +55,6 @@ struct	stainfo_rxcache	{
 */
 };
 
-struct smooth_rssi_data {
-	u32	elements[100];	/* array to store values */
-	u32	index;			/* index to current array to store */
-	u32	total_num;		/* num of valid elements */
-	u32	total_val;		/* sum of valid elements */
-};
-
 struct signal_stat {
 	u8	update_req;		/* used to indicate */
 	u8	avg_val;		/* avg of valid elements */
-- 
2.30.2


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

* [PATCH v2 2/7] staging: r8188eu: irq_prepare_beacon_tasklet is unused
  2022-02-26 18:14 ` [PATCH v2 0/7] staging: r8188eu: some removals, fix an endless loop Martin Kaiser
  2022-02-26 18:14   ` [PATCH v2 1/7] staging: r8188eu: smooth_rssi_data is not used Martin Kaiser
@ 2022-02-26 18:14   ` Martin Kaiser
  2022-02-26 18:14   ` [PATCH v2 3/7] staging: r8188eu: fix endless loop in recv_func Martin Kaiser
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 18:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Pavel Skripkin, Martin Kaiser

irq_prepare_beacon_tasklet in struct recv_priv is not used for r8188eu.
Remove it.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_recv.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h
index 13df95781747..a417a70835e7 100644
--- a/drivers/staging/r8188eu/include/rtw_recv.h
+++ b/drivers/staging/r8188eu/include/rtw_recv.h
@@ -170,7 +170,6 @@ struct recv_priv {
 	struct semaphore allrxreturnevt;
 	u8	rx_pending_cnt;
 
-	struct tasklet_struct irq_prepare_beacon_tasklet;
 	struct tasklet_struct recv_tasklet;
 	struct sk_buff_head free_recv_skb_queue;
 	struct sk_buff_head rx_skb_queue;
-- 
2.30.2


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

* [PATCH v2 3/7] staging: r8188eu: fix endless loop in recv_func
  2022-02-26 18:14 ` [PATCH v2 0/7] staging: r8188eu: some removals, fix an endless loop Martin Kaiser
  2022-02-26 18:14   ` [PATCH v2 1/7] staging: r8188eu: smooth_rssi_data is not used Martin Kaiser
  2022-02-26 18:14   ` [PATCH v2 2/7] staging: r8188eu: irq_prepare_beacon_tasklet is unused Martin Kaiser
@ 2022-02-26 18:14   ` Martin Kaiser
  2022-02-26 18:14   ` [PATCH v2 4/7] staging: r8188eu: cnt is set but not used Martin Kaiser
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 18:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Pavel Skripkin, Martin Kaiser

Fix an endless loop in recv_func. If pending_frame is not NULL, we're
stuck in the while loop forever. We have to call rtw_alloc_recvframe
each time we loop.

Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Reported-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/core/rtw_recv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index 0144c4642911..c9878907de33 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -1800,8 +1800,7 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe)
 		struct recv_frame *pending_frame;
 		int cnt = 0;
 
-		pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue);
-		while (pending_frame) {
+		while ((pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue))) {
 			cnt++;
 			recv_func_posthandle(padapter, pending_frame);
 		}
-- 
2.30.2


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

* [PATCH v2 4/7] staging: r8188eu: cnt is set but not used
  2022-02-26 18:14 ` [PATCH v2 0/7] staging: r8188eu: some removals, fix an endless loop Martin Kaiser
                     ` (2 preceding siblings ...)
  2022-02-26 18:14   ` [PATCH v2 3/7] staging: r8188eu: fix endless loop in recv_func Martin Kaiser
@ 2022-02-26 18:14   ` Martin Kaiser
  2022-02-26 18:14   ` [PATCH v2 5/7] staging: r8188eu: recvframe_push is " Martin Kaiser
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 18:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Pavel Skripkin, Martin Kaiser

In function recv_func, the cnt variable is set but not used.
It can be removed.

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

diff --git a/drivers/staging/r8188eu/core/rtw_recv.c b/drivers/staging/r8188eu/core/rtw_recv.c
index c9878907de33..6dacb2687034 100644
--- a/drivers/staging/r8188eu/core/rtw_recv.c
+++ b/drivers/staging/r8188eu/core/rtw_recv.c
@@ -1798,12 +1798,9 @@ static int recv_func(struct adapter *padapter, struct recv_frame *rframe)
 	if (check_fwstate(mlmepriv, WIFI_STATION_STATE) &&
 	    psecuritypriv->busetkipkey) {
 		struct recv_frame *pending_frame;
-		int cnt = 0;
 
-		while ((pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue))) {
-			cnt++;
+		while ((pending_frame = rtw_alloc_recvframe(&padapter->recvpriv.uc_swdec_pending_queue)))
 			recv_func_posthandle(padapter, pending_frame);
-		}
 	}
 
 	ret = recv_func_prehandle(padapter, rframe);
-- 
2.30.2


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

* [PATCH v2 5/7] staging: r8188eu: recvframe_push is not used
  2022-02-26 18:14 ` [PATCH v2 0/7] staging: r8188eu: some removals, fix an endless loop Martin Kaiser
                     ` (3 preceding siblings ...)
  2022-02-26 18:14   ` [PATCH v2 4/7] staging: r8188eu: cnt is set but not used Martin Kaiser
@ 2022-02-26 18:14   ` Martin Kaiser
  2022-02-26 18:14   ` [PATCH v2 6/7] staging: r8188eu: get_rx_status " Martin Kaiser
  2022-02-26 18:14   ` [PATCH v2 7/7] staging: r8188eu: remove unused define Martin Kaiser
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 18:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Pavel Skripkin, Martin Kaiser

The recvframe_push function is not used. It can be removed.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_recv.h | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h
index a417a70835e7..25afcbe862e6 100644
--- a/drivers/staging/r8188eu/include/rtw_recv.h
+++ b/drivers/staging/r8188eu/include/rtw_recv.h
@@ -286,26 +286,6 @@ static inline u8 *get_rx_status(struct recv_frame *precvframe)
 	return get_rxmem(precvframe);
 }
 
-static inline u8 *recvframe_push(struct recv_frame *precvframe, int sz)
-{
-	/*  append data before rx_data */
-
-	/* add data to the start of recv_frame
- *
- *      This function extends the used data area of the recv_frame at the buffer
- *      start. rx_data must be still larger than rx_head, after pushing.
- */
-	if (precvframe == NULL)
-		return NULL;
-	precvframe->rx_data -= sz ;
-	if (precvframe->rx_data < precvframe->rx_head) {
-		precvframe->rx_data += sz;
-		return NULL;
-	}
-	precvframe->len += sz;
-	return precvframe->rx_data;
-}
-
 static inline u8 *recvframe_pull(struct recv_frame *precvframe, int sz)
 {
 	/*  rx_data += sz; move rx_data sz bytes  hereafter */
-- 
2.30.2


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

* [PATCH v2 6/7] staging: r8188eu: get_rx_status is not used
  2022-02-26 18:14 ` [PATCH v2 0/7] staging: r8188eu: some removals, fix an endless loop Martin Kaiser
                     ` (4 preceding siblings ...)
  2022-02-26 18:14   ` [PATCH v2 5/7] staging: r8188eu: recvframe_push is " Martin Kaiser
@ 2022-02-26 18:14   ` Martin Kaiser
  2022-02-26 18:14   ` [PATCH v2 7/7] staging: r8188eu: remove unused define Martin Kaiser
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 18:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Pavel Skripkin, Martin Kaiser

Remove the unused function get_rx_status.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_recv.h | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h
index 25afcbe862e6..d2c1efbe62f0 100644
--- a/drivers/staging/r8188eu/include/rtw_recv.h
+++ b/drivers/staging/r8188eu/include/rtw_recv.h
@@ -281,11 +281,6 @@ static inline u8 *get_rxmem(struct recv_frame *precvframe)
 	return precvframe->rx_head;
 }
 
-static inline u8 *get_rx_status(struct recv_frame *precvframe)
-{
-	return get_rxmem(precvframe);
-}
-
 static inline u8 *recvframe_pull(struct recv_frame *precvframe, int sz)
 {
 	/*  rx_data += sz; move rx_data sz bytes  hereafter */
-- 
2.30.2


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

* [PATCH v2 7/7] staging: r8188eu: remove unused define
  2022-02-26 18:14 ` [PATCH v2 0/7] staging: r8188eu: some removals, fix an endless loop Martin Kaiser
                     ` (5 preceding siblings ...)
  2022-02-26 18:14   ` [PATCH v2 6/7] staging: r8188eu: get_rx_status " Martin Kaiser
@ 2022-02-26 18:14   ` Martin Kaiser
  6 siblings, 0 replies; 20+ messages in thread
From: Martin Kaiser @ 2022-02-26 18:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Pavel Skripkin, Martin Kaiser

Remove the rtw_dequeue_recvframe define, which is not used.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/rtw_recv.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/r8188eu/include/rtw_recv.h b/drivers/staging/r8188eu/include/rtw_recv.h
index d2c1efbe62f0..6a6f6373467b 100644
--- a/drivers/staging/r8188eu/include/rtw_recv.h
+++ b/drivers/staging/r8188eu/include/rtw_recv.h
@@ -264,7 +264,6 @@ struct recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue);
 struct recv_frame *rtw_alloc_recvframe(struct __queue *pfree_recv_queue);
 int  rtw_free_recvframe(struct recv_frame *precvframe,
 			struct __queue *pfree_recv_queue);
-#define rtw_dequeue_recvframe(queue) rtw_alloc_recvframe(queue)
 int _rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue);
 int rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue);
 void rtw_free_recvframe_queue(struct __queue *pframequeue,
-- 
2.30.2


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

end of thread, other threads:[~2022-02-26 18:15 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-26 14:48 [PATCH 0/6] staging: r8188eu: another round of removals Martin Kaiser
2022-02-26 14:48 ` [PATCH 1/6] staging: r8188eu: smooth_rssi_data is not used Martin Kaiser
2022-02-26 14:48 ` [PATCH 2/6] staging: r8188eu: irq_prepare_beacon_tasklet is unused Martin Kaiser
2022-02-26 14:48 ` [PATCH 3/6] staging: r8188eu: cnt is set but not used Martin Kaiser
2022-02-26 16:57   ` Pavel Skripkin
2022-02-26 17:32     ` Pavel Skripkin
2022-02-26 18:07       ` Martin Kaiser
2022-02-26 18:09         ` Pavel Skripkin
2022-02-26 17:59     ` Martin Kaiser
2022-02-26 14:48 ` [PATCH 4/6] staging: r8188eu: recvframe_push is " Martin Kaiser
2022-02-26 14:48 ` [PATCH 5/6] staging: r8188eu: get_rx_status " Martin Kaiser
2022-02-26 14:48 ` [PATCH 6/6] staging: r8188eu: remove unused define Martin Kaiser
2022-02-26 18:14 ` [PATCH v2 0/7] staging: r8188eu: some removals, fix an endless loop Martin Kaiser
2022-02-26 18:14   ` [PATCH v2 1/7] staging: r8188eu: smooth_rssi_data is not used Martin Kaiser
2022-02-26 18:14   ` [PATCH v2 2/7] staging: r8188eu: irq_prepare_beacon_tasklet is unused Martin Kaiser
2022-02-26 18:14   ` [PATCH v2 3/7] staging: r8188eu: fix endless loop in recv_func Martin Kaiser
2022-02-26 18:14   ` [PATCH v2 4/7] staging: r8188eu: cnt is set but not used Martin Kaiser
2022-02-26 18:14   ` [PATCH v2 5/7] staging: r8188eu: recvframe_push is " Martin Kaiser
2022-02-26 18:14   ` [PATCH v2 6/7] staging: r8188eu: get_rx_status " Martin Kaiser
2022-02-26 18:14   ` [PATCH v2 7/7] staging: r8188eu: remove unused define Martin Kaiser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).