From patchwork Mon Jan 23 20:53:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47379 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811025wrn; Mon, 23 Jan 2023 12:56:12 -0800 (PST) X-Google-Smtp-Source: AMrXdXt6jmf58PVCiHQRsabY1iP5uzaYM6odLSlpvNcniTJmEWpcnIxVkU4j/Z79y1oo8o8Y4OD8 X-Received: by 2002:a05:6402:1cb2:b0:49e:f052:d9d3 with SMTP id cz18-20020a0564021cb200b0049ef052d9d3mr11485053edb.15.1674507372209; Mon, 23 Jan 2023 12:56:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507372; cv=none; d=google.com; s=arc-20160816; b=tTi6HuCmUPBOzQUhy6UlLNXXqpX+hyw0gGEDNphBHf+6EcdhOb2NZ789IX+3dItKBl LFcbZBzIDB2yBDJ/yyfaUn01A0lUqwc3LYnodErrhBRu8D9QFu3kERb9HGOHWx0yV1Bj ROpNVLF7eBLP/na3oCaXQFPj+S/IfcRiaJ5lhdSdBCX8L4/YaqKPbjOmUfGZFF5zJJJD G1xzgJUAjdN1d1y2rU9WrTBGW9usx9zgWmjuQakiK78cPpNNAlU7N+qHrtUbeZLhbn1n KTjooyDA+TxW6jmoYUfC3nDV+H4VylSwBID2Jk780h0DiEQGRffzoq0i+utfH6Vcxm1N 6LSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=YTGSnnIjLTtZWWRogY8sSNKjOoky/D8P295B43Izbd0=; b=wRjNuYEjLltk2yoBB6guaRvsII7SjCtteyvF3yX+WnFlsYrRIVexv9mcBMNSCefv/9 P7N8Y3gjcHRVo5Ht3iCZVVwrCrRjYWhwU1eNlrwXMaUdkXLrj3bfkpUng2d3yyHNNqUL TVZT8Yzl6Y7DDrB272MZa/vYxGRmuOuGwX1qejAlPrJqWSAaKktfatpY+AFxoTLlk4hM GXM6tExWiSnU206T9J8x6qRMXbP06JEkwlgKMLNxgIcu/FgLhJtsxQSukMc2rPl1R9LB MTLfoiXatHd4q/oKFiFljBq6RxQdFV1CaCh1ZM23tyUyxR237LjKEUS7OSlB16MvxTwX r8AQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw16-20020a056402229000b0048e82d753a3si440453edb.227.2023.01.23.12.55.47; Mon, 23 Jan 2023 12:56:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232490AbjAWUyo (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232158AbjAWUyU (ORCPT ); Mon, 23 Jan 2023 15:54:20 -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 727B332E47 for ; Mon, 23 Jan 2023 12:54:13 -0800 (PST) Received: from ipservice-092-217-089-134.092.217.pools.vodafone-ip.de ([92.217.89.134] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1pK3pO-0000Lk-80; Mon, 23 Jan 2023 21:54:06 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 14/23] staging: r8188eu: decrement qcnt in rtw_dequeue_xframe Date: Mon, 23 Jan 2023 21:53:33 +0100 Message-Id: <20230123205342.229589-15-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230123205342.229589-1-martin@kaiser.cx> References: <20230123205342.229589-1-martin@kaiser.cx> MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755848242518025483?= X-GMAIL-MSGID: =?utf-8?q?1755848242518025483?= rtw_dequeue_xframe calls dequeue_one_xmitframe and passes a struct tx_servq. The only use for this parameter is to decrement its qcnt if an xmit_frame could be extracted. It makes more sense to remove the struct tx_servq parameter from dequeue_one_xmitframe and decrement qcnt in the calling function when dequeue_one_xmitframe returns success, i.e. when an xmit_frame was extracted. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 96079d9a6c42..7802a34ebcfd 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1355,7 +1355,7 @@ s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitfram return _SUCCESS; } -static struct xmit_frame *dequeue_one_xmitframe(struct tx_servq *ptxservq, struct __queue *pframe_queue) +static struct xmit_frame *dequeue_one_xmitframe(struct __queue *pframe_queue) { struct list_head *xmitframe_plist, *xmitframe_phead; struct xmit_frame *pxmitframe; @@ -1367,7 +1367,6 @@ static struct xmit_frame *dequeue_one_xmitframe(struct tx_servq *ptxservq, struc xmitframe_plist = xmitframe_phead->next; pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); list_del_init(&pxmitframe->list); - ptxservq->qcnt--; return pxmitframe; } @@ -1398,10 +1397,11 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi pframe_queue = &ptxservq->sta_pending; - pxmitframe = dequeue_one_xmitframe(ptxservq, pframe_queue); + pxmitframe = dequeue_one_xmitframe(pframe_queue); if (pxmitframe) { phwxmit->accnt--; + ptxservq->qcnt--; /* Remove sta node when there are no pending packets. */ if (list_empty(&pframe_queue->queue))