All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Pavel Skripkin <paskripkin@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	Michael Straube <straube.linux@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/6] staging: r8188eu: cnt is set but not used
Date: Sat, 26 Feb 2022 19:07:06 +0100	[thread overview]
Message-ID: <20220226180706.wierfb2ancom32zn@viti.kaiser.cx> (raw)
In-Reply-To: <184f741c-60ed-fe32-5705-08f9769e926a@gmail.com>

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

  reply	other threads:[~2022-02-26 18:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220226180706.wierfb2ancom32zn@viti.kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=paskripkin@gmail.com \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.