From patchwork Mon Jan 23 20:53:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47390 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811202wrn; Mon, 23 Jan 2023 12:56:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXuzrMlytf8khR2vxwPmxOiqdpMpw3yiLujtkYUpry/9ia2t9RV1RiF9ZjLhkVpTlM/vdOQe X-Received: by 2002:a05:6a21:33a1:b0:b9:92c2:7ece with SMTP id yy33-20020a056a2133a100b000b992c27ecemr14944743pzb.34.1674507403210; Mon, 23 Jan 2023 12:56:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507403; cv=none; d=google.com; s=arc-20160816; b=OETU41PLdCWab1G5loeAwGfpcBCu1NyhghCblxxbm0OD7ElO0ap7i+HmvVsMcBFnWy yvK33QwwLAZdlPAXKATkIakxM19tlrjiLBQN2HcXclryeQ+4tvp5VAJLv23ljtnwd6VD mwoqwwp5npPr2pkmUnpNiJq9JO/+U9+wmWuqqTLzKzBHlMgeVRtMuCarekml4Hze/Bi5 3DTvV+5bxphT4UUFlZKoAiUQifTLWAyGUnmcsLd8kHIfDfGProO/1CcHK76cwxL+KtT/ VZ5FD7p0Efq5cl0BbFnTIj1LlAJpzapjrl/qVWylIu4DlUJFOh4n47bfSVg2QEQBKtkw 9qOA== 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=AfZK8MRqrUjx3E5K5YT0LuvLXx0gxaVnvRdyE4aRz+M=; b=ftoDfECopXyx2RU5KdO/GTukENygw58Zc6eyZIv2ghVDsGqdMhz02XXS7NbNqCYOyY 5Ml59NdmShCavXmPCefCA+G9oHANST/uEESJxFKskzLsLbD9q83pDrKB7Qe4eAaKWRP3 kYvvAVusk4qVRA3BGeYIVHSlXUoErEAeKt+kBayq2xysL7hxoJEEYREMLPw4XkXlU5MD /g7fVZDePO4AKYWH0mr7gd557+UzSn/obu9xqljSD4Th0Le9IRBKFi5DchsqK4AQhuQk ifAsp5eZii2gYcAbbNTAD+LlhTt9QVkCK/c9lTfl50AzvlLPNAQcEg1pkeRNmh1vsldX T9wA== 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 a11-20020a63d40b000000b004d274290431si13602531pgh.84.2023.01.23.12.56.31; Mon, 23 Jan 2023 12:56:43 -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 S232111AbjAWUzB (ORCPT + 99 others); Mon, 23 Jan 2023 15:55:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232021AbjAWUyU (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 725AA2DE5C 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 1pK3pQ-0000Lk-HU; Mon, 23 Jan 2023 21:54:08 +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 17/23] staging: r8188eu: merge dequeue_one_xmitframe into its caller Date: Mon, 23 Jan 2023 21:53:36 +0100 Message-Id: <20230123205342.229589-18-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?1755848274598800534?= X-GMAIL-MSGID: =?utf-8?q?1755848274598800534?= dequeue_one_xmitframe is a small function that is called only from rtw_dequeue_xframe. Merge the two functions. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 34 +++++++++---------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 6060a1832431..cb0d8346ac10 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1355,18 +1355,6 @@ s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitfram return _SUCCESS; } -static struct xmit_frame *dequeue_one_xmitframe(struct list_head *xframe_list) -{ - struct xmit_frame *pxmitframe; - - if (list_empty(xframe_list)) - return NULL; - - pxmitframe = container_of(xframe_list->next, struct xmit_frame, list); - list_del_init(&pxmitframe->list); - return pxmitframe; -} - struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i) { struct list_head *sta_phead; @@ -1391,19 +1379,21 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi sta_phead = get_list_head(phwxmit->sta_queue); list_for_each_entry_safe(ptxservq, tmp_txservq, sta_phead, tx_pending) { - xframe_list = get_list_head(&ptxservq->sta_pending); - pxmitframe = dequeue_one_xmitframe(xframe_list); + if (list_empty(xframe_list)) + continue; - if (pxmitframe) { - phwxmit->accnt--; - ptxservq->qcnt--; + pxmitframe = container_of(xframe_list->next, struct xmit_frame, list); + list_del_init(&pxmitframe->list); - /* Remove sta node when there are no pending packets. */ - if (list_empty(xframe_list)) - list_del_init(&ptxservq->tx_pending); - goto exit; - } + phwxmit->accnt--; + ptxservq->qcnt--; + + /* Remove sta node when there are no pending packets. */ + if (list_empty(xframe_list)) + list_del_init(&ptxservq->tx_pending); + + goto exit; } } exit: