From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3219C433EF for ; Sat, 26 Feb 2022 18:07:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232517AbiBZSHs (ORCPT ); Sat, 26 Feb 2022 13:07:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230391AbiBZSHq (ORCPT ); Sat, 26 Feb 2022 13:07:46 -0500 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A530551331 for ; Sat, 26 Feb 2022 10:07:11 -0800 (PST) Received: from martin by viti.kaiser.cx with local (Exim 4.89) (envelope-from ) id 1nO1TG-00016A-Ub; Sat, 26 Feb 2022 19:07:06 +0100 Date: Sat, 26 Feb 2022 19:07:06 +0100 From: Martin Kaiser To: Pavel Skripkin Cc: Greg Kroah-Hartman , Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/6] staging: r8188eu: cnt is set but not used Message-ID: <20220226180706.wierfb2ancom32zn@viti.kaiser.cx> References: <20220226144843.1118951-1-martin@kaiser.cx> <20220226144843.1118951-4-martin@kaiser.cx> <1c44c931-5b90-03d8-94bd-5e68682c4787@gmail.com> <184f741c-60ed-fe32-5705-08f9769e926a@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <184f741c-60ed-fe32-5705-08f9769e926a@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: Martin Kaiser Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > > --- > > > 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