From patchwork Mon Jan 23 20:53:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47395 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811709wrn; Mon, 23 Jan 2023 12:58:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXvRLpLkkV48weMTmUzXlMB/PxOICZi2l+6uiubsqWHAOWql2QgRLFqusIXI46np6N78xDPW X-Received: by 2002:a17:90a:1a04:b0:22b:b448:e88 with SMTP id 4-20020a17090a1a0400b0022bb4480e88mr12893567pjk.5.1674507508136; Mon, 23 Jan 2023 12:58:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507508; cv=none; d=google.com; s=arc-20160816; b=cqRZYvXcxGHL7kIXnUSn8+pOuodDRhscvIoaoom7ooeGnlj00YlxpHKGjkDSNKMhxW DaTQimhMy/vdZJUzQl0i82CTmUgndf0CGH5SblYjM8KeKht5C5gS6rcpMErTLIm9ABCg 7tJhV0HEAXZgV6PSl5GCBZiYliBjJJWP1NrLGH1kfxoo4yzjKNtm+lADx/SWu+QANyIk 1MUBvScZYbv5zuVOU8DvCWCctnETeOQyNasiN7AHmiShvAyrQCh7R0QC9aZExiF/BSRw F5AH8jRc9x5AhQRZ5yo1Sh5WZlPjVCTRk8NThcnr4i1uTDkaYQiK/TVL+oaay38P1DtK FdJw== 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=8A6T3JWD4aVd7hp//PBVW+NRsXlahKXCvTUf22XwYNs=; b=mjDfTynj6e5eqTJ/Dfu+fV8AvBPRyOyIdKsXzWU7ZoZdWdMKbljgvPjejW6tBEdyms gYTg3H+2IXcCVtjb2P+iFvPg9OdiuABhlobmXbi8mIIvSfV7lKRaegKDh9ChvA0eZQcG EQXvzx9nuYh5QgaNavdjwtBYHHQ5/WdL+uoDyEuz6boMaes2oRfAbudfe6kMGfuRxqkc klAQnnSP4IjhWwdyxsN++YvEiX1p1LDShJCl6x4chqioDyiHqX5ckx3bY4xsoCRP1VUX TvvSBEsAukevjjrmE9Qw6MUQ66cWMxMQDc5uGRKZrLnh9zVHCmZt41hziGE7U7gqxIFQ HI/Q== 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 u2-20020a17090adb4200b0021870b9d3c7si278496pjx.45.2023.01.23.12.58.04; Mon, 23 Jan 2023 12:58:28 -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 S231601AbjAWUzE (ORCPT + 99 others); Mon, 23 Jan 2023 15:55:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232238AbjAWUy2 (ORCPT ); Mon, 23 Jan 2023 15:54:28 -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 6D9F23801B for ; Mon, 23 Jan 2023 12:54:14 -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 1pK3pP-0000Lk-NC; Mon, 23 Jan 2023 21:54:07 +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 16/23] staging: r8188eu: use list_head for xmitframe list Date: Mon, 23 Jan 2023 21:53:35 +0100 Message-Id: <20230123205342.229589-17-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?1755848384633545112?= X-GMAIL-MSGID: =?utf-8?q?1755848384633545112?= The r8188eu driver defines a struct __queue that contains a list_head and a spinlock. struct tx_servq describes a station for which we have pending tx packets. This struct contains a __queue for the pending packets (a __queue of struct xmit_frame entries). In this particular case, the queue's spinlock is not used, we need only the list_head. rtw_dequeue_xframe uses a local variable for such an xmit_frame queue. This patch replaces this variable with a list_head. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 79a1999ca809..6060a1832431 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1355,15 +1355,14 @@ s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitfram return _SUCCESS; } -static struct xmit_frame *dequeue_one_xmitframe(struct __queue *pframe_queue) +static struct xmit_frame *dequeue_one_xmitframe(struct list_head *xframe_list) { - struct list_head *xmitframe_phead = get_list_head(pframe_queue); struct xmit_frame *pxmitframe; - if (list_empty(xmitframe_phead)) + if (list_empty(xframe_list)) return NULL; - pxmitframe = container_of(xmitframe_phead->next, struct xmit_frame, list); + pxmitframe = container_of(xframe_list->next, struct xmit_frame, list); list_del_init(&pxmitframe->list); return pxmitframe; } @@ -1373,7 +1372,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi struct list_head *sta_phead; struct hw_xmit *phwxmit; struct tx_servq *ptxservq, *tmp_txservq; - struct __queue *pframe_queue = NULL; + struct list_head *xframe_list; struct xmit_frame *pxmitframe = NULL; struct adapter *padapter = pxmitpriv->adapter; struct registry_priv *pregpriv = &padapter->registrypriv; @@ -1393,16 +1392,15 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi list_for_each_entry_safe(ptxservq, tmp_txservq, sta_phead, tx_pending) { - pframe_queue = &ptxservq->sta_pending; - - pxmitframe = dequeue_one_xmitframe(pframe_queue); + xframe_list = get_list_head(&ptxservq->sta_pending); + pxmitframe = dequeue_one_xmitframe(xframe_list); if (pxmitframe) { phwxmit->accnt--; ptxservq->qcnt--; /* Remove sta node when there are no pending packets. */ - if (list_empty(&pframe_queue->queue)) + if (list_empty(xframe_list)) list_del_init(&ptxservq->tx_pending); goto exit; }