From patchwork Mon Jan 23 20:53:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47381 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811055wrn; Mon, 23 Jan 2023 12:56:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXvE3PJKCwQK/e8TnYFMJuirxix0J+MrxFRW6skU3N50VFw5wWgQdBRGzHFye0S1y69x74Fx X-Received: by 2002:a17:907:9150:b0:84d:150d:5006 with SMTP id l16-20020a170907915000b0084d150d5006mr24698558ejs.49.1674507379348; Mon, 23 Jan 2023 12:56:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507379; cv=none; d=google.com; s=arc-20160816; b=MyZlp9ZiEOPOtfQa5eSRMbvhP2gcI/HbIvFky+7rUdEb5HAv142Rre5zHFWvkkDBE/ 8zhEW9uP6ALe16IPMHBgRwBfmfmBbFVH3ohYljA7AxUjonOmErif5QC+RkCWXA1s0FOQ dvxv7u1Wpe8kxtkJX4mDhtIri3K2MWMOSlUYxP19GqhI7bbFQ4Wbx+6DjlZy0EUjlFul gBy2sb7kegFr9ItJV7+oV+B+Y2ET0UREKoSiw97YOHxoxU/AMUgyQjYtGjdsSxfCwyGO 9B8Hl8LrMYWL8NQ/W3fi2NTcFBbSJcnrQEtcxPjalqgtwwjEMo+mU+Eqsx9CA0urLZuw h8XA== 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=tHwhIWxeYt5X/8lYAui/YFafjM3KUNTZFiG5I8NHkQI=; b=AfCvRj1VrvyaSSM10zq01cobBaRedSjhyq+69KF3vgfxIlPuNeJovAl+7f0tj4rwon 3y/MIm4BHXFE6gsFkyxV3Y3RcBDZYCKI9chqG31RXfnVSLnI3Zk5DRfWCxD1GY4QIcFC hkAe6IC3GK2nnhryawkrPfkd6+JOmPcrxbGpySki+nM4+BsiYqzOdAdxlGpCNW5Bqz3I p8ST2/Mm2d91GxVn3JcAvxumJwHDEq3z2jrUgJGNh47oEugwO2vhD60V7s06rzjtKUXs ZjB9SqDMzBZAH6+jnMP5OVwoBy+QsAPhW91rzbqjhc7lnJKHYuTLlVIl0OUwhbFyr7ZI gdRw== 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 gs16-20020a1709072d1000b0087752be1dcasi21272724ejc.914.2023.01.23.12.55.54; Mon, 23 Jan 2023 12:56:19 -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 S231872AbjAWUyJ (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231548AbjAWUyD (ORCPT ); Mon, 23 Jan 2023 15:54:03 -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 D8DEF83DE for ; Mon, 23 Jan 2023 12:54:01 -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 1pK3pD-0000Lk-Uh; Mon, 23 Jan 2023 21:53:56 +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 01/23] staging: r8188eu: we use a constant number of hw_xmit entries Date: Mon, 23 Jan 2023 21:53:20 +0100 Message-Id: <20230123205342.229589-2-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?1755848249717721433?= X-GMAIL-MSGID: =?utf-8?q?1755848249717721433?= struct xmit_priv contains a pointer to an array of struct hw_xmit entries. xmit_priv's (ill-named) hwxmit_entry component stores the size of this array, i.e. the number of hw_xmit entries that are used. The array size is constant, it's initialised to HWXMIT_ENTRY and never updated. Simplify the code accordingly. Remove hwxmit_entry, do not pass the array size as a function parameter and use HWXMIT_ENTRY in the code that handles the array. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 8 +++----- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 2 +- drivers/staging/r8188eu/include/rtw_xmit.h | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index c51f6eabef87..5f2426be6c11 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1375,7 +1375,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str return pxmitframe; } -struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i, int entry) +struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i) { struct list_head *sta_plist, *sta_phead; struct hw_xmit *phwxmit; @@ -1397,7 +1397,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi spin_lock_bh(&pxmitpriv->lock); - for (i = 0; i < entry; i++) { + for (i = 0; i < HWXMIT_ENTRY; i++) { phwxmit = phwxmit_i + inx[i]; sta_phead = get_list_head(phwxmit->sta_queue); @@ -1501,9 +1501,7 @@ int rtw_alloc_hwxmits(struct adapter *padapter) struct hw_xmit *hwxmits; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - pxmitpriv->hwxmit_entry = HWXMIT_ENTRY; - - pxmitpriv->hwxmits = kcalloc(pxmitpriv->hwxmit_entry, sizeof(struct hw_xmit), GFP_KERNEL); + pxmitpriv->hwxmits = kcalloc(HWXMIT_ENTRY, sizeof(struct hw_xmit), GFP_KERNEL); if (!pxmitpriv->hwxmits) return -ENOMEM; diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c index d1af76cc2091..e097fa14dc6e 100644 --- a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +++ b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c @@ -398,7 +398,7 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmit if (!pxmitbuf) return false; - pxmitframe = rtw_dequeue_xframe(pxmitpriv, pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry); + pxmitframe = rtw_dequeue_xframe(pxmitpriv, pxmitpriv->hwxmits); if (!pxmitframe) { /* no more xmit frame, release xmit buffer */ rtw_free_xmitbuf(pxmitpriv, pxmitbuf); diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index 883eacd98224..cc32167fb4dc 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -273,7 +273,6 @@ struct xmit_priv { u64 last_tx_bytes; u64 last_tx_pkts; struct hw_xmit *hwxmits; - u8 hwxmit_entry; u8 wmm_para_seq[4];/* sequence for wmm ac parameter strength * from large to small. it's value is 0->vo, * 1->vi, 2->be, 3->bk. */ @@ -324,7 +323,7 @@ struct tx_servq *rtw_get_sta_pending(struct adapter *padapter, s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitframe); struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, - struct hw_xmit *phwxmit_i, int entry); + struct hw_xmit *phwxmit_i); s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe); From patchwork Mon Jan 23 20:53:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47382 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811081wrn; Mon, 23 Jan 2023 12:56:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXtV/VSQCdIP7EZjcSJD4krjwwsd54yGRHEFH/ZJrRicC5iReFz5WrRfA3lnm9FS6ZMG+/tj X-Received: by 2002:a17:906:514:b0:7c1:1ada:5e1e with SMTP id j20-20020a170906051400b007c11ada5e1emr26795828eja.26.1674507384354; Mon, 23 Jan 2023 12:56:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507384; cv=none; d=google.com; s=arc-20160816; b=ma4XjDXt/sY6IjMASLDFaRD9ivAh4dUCbdCpb8vSLB+IKZwP1TNgjKMTgnd/If8Q/L vrjnlOW+3QPllN9Bs48QL4xRCOAYWw2n/hghL87smmt62ScDzGSTtCsXU7/X9myizbvH mZSMLZckRxuhG5qaNCYNV93xaoUz+LQOV1egmJVZH/TDUbCMlkl05qcPQ/zNEjY7Hty1 G9WtsJ7J6sQRpqWHI0nGJtNDFHreVP5e2KA5dTpPD0L7TUG9BZY/B9uwegsmE7QqVcNc HE3qtKg6vRJVjCDw0tg2RmvIbgrrSPMTrO7g7xf45xzUKZlf1icR8J5Hoe71sSxUVwaV v/0Q== 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=lIUtaP8l8gzOTNyJnWjB4W6hadiqMYf0s7jx4vFGzh0=; b=IEQ55q307Vi5zXs3I3Xcs1Z6LTterVTozopxx8ptOBm20uRgBCISrkTo7I2mBRhbzd zG42+XSQwkp2MN2HMCPJHDIhqLtRzYR5E4r3cJdCNXt2XJ94jbKbS/5vPZZ2BE2kbb4q nq95oP+v6spUorHBfR+sN4vTgzO96F679DmCx7hbvwsDCY4O5rCmVBpHsDU04c0Uc25F wWH4nycV8NFaV8/v0M75UNSHpNyCdGM3cZ5yNyRKOrwrBfIhEnTQslZsHVKpoaKxbFCe sqjwtsh7X/Okd4000zLCjtiu4V5oIIlaQvJq4DQExsMPHahpZO1SmvGmG3r6P90B0tiW LZSA== 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 he37-20020a1709073da500b008719e7f3355si7015994ejc.710.2023.01.23.12.56.00; Mon, 23 Jan 2023 12:56:24 -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 S231771AbjAWUyE (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbjAWUyC (ORCPT ); Mon, 23 Jan 2023 15:54:02 -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 D8CBD7DB5 for ; Mon, 23 Jan 2023 12:54:01 -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 1pK3pE-0000Lk-TD; Mon, 23 Jan 2023 21:53:56 +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 02/23] staging: r8188eu: pass struct adapter to usb_write Date: Mon, 23 Jan 2023 21:53:21 +0100 Message-Id: <20230123205342.229589-3-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?1755848255148144257?= X-GMAIL-MSGID: =?utf-8?q?1755848255148144257?= The usb_write function takes a struct intf_hdl only to extract the struct adapter from it. We can pass struct adapter directly. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/usb_ops_linux.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c index d82abfcd91f3..9f008e61a6f2 100644 --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c @@ -49,9 +49,8 @@ static int usb_read(struct adapter *adapt, u16 value, void *data, u8 size) return status; } -static int usb_write(struct intf_hdl *intf, u16 value, void *data, u8 size) +static int usb_write(struct adapter *adapt, u16 value, void *data, u8 size) { - struct adapter *adapt = intf->padapter; struct dvobj_priv *dvobjpriv = adapter_to_dvobj(adapt); struct usb_device *udev = dvobjpriv->pusbdev; int status; @@ -131,48 +130,44 @@ int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data) int rtw_write8(struct adapter *adapter, u32 addr, u8 val) { - struct intf_hdl *intf = &adapter->intf; u16 value = addr & 0xffff; int ret; - ret = usb_write(intf, value, &val, 1); + ret = usb_write(adapter, value, &val, 1); return RTW_STATUS_CODE(ret); } int rtw_write16(struct adapter *adapter, u32 addr, u16 val) { - struct intf_hdl *intf = &adapter->intf; u16 value = addr & 0xffff; __le16 data = cpu_to_le16(val); int ret; - ret = usb_write(intf, value, &data, 2); + ret = usb_write(adapter, value, &data, 2); return RTW_STATUS_CODE(ret); } int rtw_write32(struct adapter *adapter, u32 addr, u32 val) { - struct intf_hdl *intf = &adapter->intf; u16 value = addr & 0xffff; __le32 data = cpu_to_le32(val); int ret; - ret = usb_write(intf, value, &data, 4); + ret = usb_write(adapter, value, &data, 4); return RTW_STATUS_CODE(ret); } int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *data) { - struct intf_hdl *intf = &adapter->intf; u16 value = addr & 0xffff; if (length > VENDOR_CMD_MAX_DATA_LEN) return -EINVAL; - return usb_write(intf, value, data, length); + return usb_write(adapter, value, data, length); } static void handle_txrpt_ccx_88e(struct adapter *adapter, u8 *buf) From patchwork Mon Jan 23 20:53:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47378 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1810665wrn; Mon, 23 Jan 2023 12:55:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXsbsjdVj8XXorbxZSMTDA0c4mU5gnrM/Cf25Fwn3rsNBP0aKoQ+R9UVoF+3xfpkQeQTGuHw X-Received: by 2002:a17:906:6d99:b0:870:58ae:842e with SMTP id h25-20020a1709066d9900b0087058ae842emr25575017ejt.24.1674507308645; Mon, 23 Jan 2023 12:55:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507308; cv=none; d=google.com; s=arc-20160816; b=w+yTsCnUUbD4bDBl80BnUVWRWaQyNvk6eHjYJfZTajMe4IEbtXd0/HL4zdqdxhpPZT WoxEhfmlW4/bw4L8347gN5ikadaSzEGA88VQfJXAWvo4QmmHh7eSFpy6YKqzcf2Nv4YP kQxtBE+VuP/QB7eJjH+LSHptpgdTFZm/eXB1GbDq7UjBm7XKR6vvSAxbZ/qGjH9ovGCk dN2079MA8sPgjfR0HpEWOwiKIUfPGo668fn6eeL0Cv9MhZgHFrrigNSaZqzSkRD4NDj4 WBxrndVA7pJ50AxKVV5qN+icILbXVcl2ca+MDf7ogiHzIilJaSMmOfGWyis9zu+uCLif VNrA== 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=shOVnwlnoa30gNx4hfB4z3eh8SEpgooftb+mKN07HeM=; b=rdBFxSLE/ahid7+l1yKC1wP3hcqSF0+HL6l0MIks92fqSg9n3DCJmqbQrphQ514TUC n4qoaVaOpJrrmyqUSV42QndOoiZHAGoO4QdoVeuXhzbH/2C06LZZFRlBA21hRTWl+/5E TJCvpzJkuiviIj+NtPtuMvFB5/EaZL4GOhGrzw8bPXGvwRLoa9FbFgph6DNKh3Kx1mm+ JbdqozMN323XdHB+ZyMKh2jmlin+MJbJU/4ImML7t+CYZ9VMtxcEbnw+6358zVMMhbme uNSCCVqBkxgtN0zH+DhkHkkbG3tE6C6OIxkrhY9JUQ/vNEU8+Dyt/94Sm/Kl8GxJDWED AcVw== 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 24-20020a170906009800b00877aab5d2d3si8621082ejc.95.2023.01.23.12.54.44; Mon, 23 Jan 2023 12:55:08 -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 S231951AbjAWUyL (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231717AbjAWUyD (ORCPT ); Mon, 23 Jan 2023 15:54:03 -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 E755B11654 for ; Mon, 23 Jan 2023 12:54:02 -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 1pK3pF-0000Lk-NR; Mon, 23 Jan 2023 21:53:57 +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 03/23] staging: r8188eu: remove struct intf_hdl Date: Mon, 23 Jan 2023 21:53:22 +0100 Message-Id: <20230123205342.229589-4-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?1755848175722431595?= X-GMAIL-MSGID: =?utf-8?q?1755848175722431595?= There are no more users of struct intf_hdl in the r8188eu driver. We can now remove this struct. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/include/drv_types.h | 1 - drivers/staging/r8188eu/include/rtw_io.h | 6 ------ drivers/staging/r8188eu/os_dep/usb_intf.c | 6 ------ 3 files changed, 13 deletions(-) diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h index 614673902377..7b170eed66b3 100644 --- a/drivers/staging/r8188eu/include/drv_types.h +++ b/drivers/staging/r8188eu/include/drv_types.h @@ -152,7 +152,6 @@ struct adapter { struct mlme_ext_priv mlmeextpriv; struct cmd_priv cmdpriv; struct evt_priv evtpriv; - struct intf_hdl intf; struct xmit_priv xmitpriv; struct recv_priv recvpriv; struct sta_priv stapriv; diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h index 0d2aa432f88d..033ea7146861 100644 --- a/drivers/staging/r8188eu/include/rtw_io.h +++ b/drivers/staging/r8188eu/include/rtw_io.h @@ -17,12 +17,6 @@ #include struct intf_priv; -struct intf_hdl; - -struct intf_hdl { - struct adapter *padapter; - struct dvobj_priv *pintf_dev; -}; int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data); int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data); diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c index 1f70e5fee1b2..1f114b1fc4d5 100644 --- a/drivers/staging/r8188eu/os_dep/usb_intf.c +++ b/drivers/staging/r8188eu/os_dep/usb_intf.c @@ -290,7 +290,6 @@ static int rtw_usb_if1_init(struct dvobj_priv *dvobj, struct usb_interface *pusb { struct adapter *padapter = NULL; struct net_device *pnetdev = NULL; - struct intf_hdl *pintf; int ret; padapter = vzalloc(sizeof(*padapter)); @@ -317,11 +316,6 @@ static int rtw_usb_if1_init(struct dvobj_priv *dvobj, struct usb_interface *pusb padapter->intf_start = &usb_intf_start; padapter->intf_stop = &usb_intf_stop; - /* step init_io_priv */ - pintf = &padapter->intf; - pintf->padapter = padapter; - pintf->pintf_dev = adapter_to_dvobj(padapter); - /* step read_chip_version */ rtl8188e_read_chip_version(padapter); From patchwork Mon Jan 23 20:53:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47387 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811188wrn; Mon, 23 Jan 2023 12:56:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXvofI0yvOBJ8LwwUvijacPNQGhHR+EtuGyCa7uEdiFRZ/FUWmj9GB7Bl1GPx41r4A9f24+2 X-Received: by 2002:aa7:cd86:0:b0:499:27e8:94a3 with SMTP id x6-20020aa7cd86000000b0049927e894a3mr28337258edv.13.1674507400925; Mon, 23 Jan 2023 12:56:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507400; cv=none; d=google.com; s=arc-20160816; b=jxr3tszHqUgOmq0QLfTZVyIwfF1RkjOyfOhC7mww9DLH351hQ7J5T95gB0Ntr3Dj3b eXh2DnHZVqOlk8EbLM6c0RjVx7CVEpevkq3bBZvdUwDVv2YvjNavy78cRHjKzLBRiSxx H8iievqzANej0aT5cw+Oz2fpOTI+UCCVfetVkIPSSEK/Js0BD4Li/DHryaN4B9EcOzEE ebOj7WOuca/gkU9CUKjVhq+f1SB9cnVsWAQwTnGTYnUHpUqH19HhUFL9Y+J+dFMmYQ4/ N34acm6nECINw9X1A7GgvBW7Fbh9z8BqGJCEmjrCCKyMAL8aM13Zgu8FyOJhcQpD9T6e g4bQ== 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=lqf2fCmLCodnxnmgFD8J1Pna+IX1Iayf7FnvCsRtai4=; b=barfV6395l14b+aI0E1dnzTsmWtfbujs9UqoJjTYgVUR0UsE0dHj8TteMdBqibxMTQ W+7yBFgFbYfNEnEYM9oQ7puvKN2UAgF+4nyQs9iTeaOlsY2tFrKIAiOAB2/0ANvbYpkJ KDBR/dkj+aw34UfrU/PXMspRdVwdPDfgahwSyuMgneyfwC5MBFqDXDljUv10rgoylyPm HNuv0O86v4aK/5aeI5efovPld7hsqROgccl7YklGyym/EJf0o6o8oQVdbQVOZZwwCPtd +PowY0RhN+vb51UFa/o4o78i2JS97djX1mfUnlblCMm0hkvMTCB3Gfl/hIe4w7z/JrJT 20Bg== 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 g35-20020a056402322300b004841817039asi425836eda.614.2023.01.23.12.56.16; Mon, 23 Jan 2023 12:56:40 -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 S232026AbjAWUyO (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231733AbjAWUyE (ORCPT ); Mon, 23 Jan 2023 15:54:04 -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 97F627DB5 for ; Mon, 23 Jan 2023 12:54:03 -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 1pK3pG-0000Lk-Fx; Mon, 23 Jan 2023 21:53:58 +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 04/23] staging: r8188eu: remove struct intf_priv Date: Mon, 23 Jan 2023 21:53:23 +0100 Message-Id: <20230123205342.229589-5-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?1755848272307054447?= X-GMAIL-MSGID: =?utf-8?q?1755848272307054447?= struct intf_priv is not used in the r8188eu driver. It can be removed. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/include/osdep_intf.h | 32 -------------------- drivers/staging/r8188eu/include/rtw_io.h | 2 -- 2 files changed, 34 deletions(-) diff --git a/drivers/staging/r8188eu/include/osdep_intf.h b/drivers/staging/r8188eu/include/osdep_intf.h index 6d66cb57225e..457fb3852a19 100644 --- a/drivers/staging/r8188eu/include/osdep_intf.h +++ b/drivers/staging/r8188eu/include/osdep_intf.h @@ -7,38 +7,6 @@ #include "osdep_service.h" #include "drv_types.h" -struct intf_priv { - u8 *intf_dev; - u32 max_iosz; /* USB2.0: 128, USB1.1: 64, SDIO:64 */ - u32 max_xmitsz; /* USB2.0: unlimited, SDIO:512 */ - u32 max_recvsz; /* USB2.0: unlimited, SDIO:512 */ - - u8 *io_rwmem; - u8 *allocated_io_rwmem; - u32 io_wsz; /* unit: 4bytes */ - u32 io_rsz;/* unit: 4bytes */ - u8 intf_status; - - void (*_bus_io)(u8 *priv); - -/* -Under Sync. IRP (SDIO/USB) -A protection mechanism is necessary for the io_rwmem(read/write protocol) - -Under Async. IRP (SDIO/USB) -The protection mechanism is through the pending queue. -*/ - struct mutex ioctl_mutex; - /* when in USB, IO is through interrupt in/out endpoints */ - struct usb_device *udev; - struct urb *piorw_urb; - u8 io_irp_cnt; - u8 bio_irp_pending; - struct timer_list io_timer; - u8 bio_irp_timeout; - u8 bio_timer_cancel; -}; - int netdev_open(struct net_device *pnetdev); int netdev_close(struct net_device *pnetdev); diff --git a/drivers/staging/r8188eu/include/rtw_io.h b/drivers/staging/r8188eu/include/rtw_io.h index 033ea7146861..090555f562f2 100644 --- a/drivers/staging/r8188eu/include/rtw_io.h +++ b/drivers/staging/r8188eu/include/rtw_io.h @@ -16,8 +16,6 @@ #include #include -struct intf_priv; - int __must_check rtw_read8(struct adapter *adapter, u32 addr, u8 *data); int __must_check rtw_read16(struct adapter *adapter, u32 addr, u16 *data); int __must_check rtw_read32(struct adapter *adapter, u32 addr, u32 *data); From patchwork Mon Jan 23 20:53:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47383 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811090wrn; Mon, 23 Jan 2023 12:56:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXtUE8ztkb2VUE6c+0Sn+st1fu3zwJAmtGExc38tPkcYKmKqMxUrO9FX+P67EL3PKX1C0FV6 X-Received: by 2002:a17:906:3b01:b0:84d:4767:734 with SMTP id g1-20020a1709063b0100b0084d47670734mr38363207ejf.6.1674507386147; Mon, 23 Jan 2023 12:56:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507386; cv=none; d=google.com; s=arc-20160816; b=ti8URcOKegR0mK4x74wxmnYpJWYbt+mPyl5EpiKiwG7Y0FgCfE6lqZv9BuX4Dekntr Cdutuh/KIrcHsq8Dz78r+KhfaFcjw7Pm9VZ7QDDbOKNTtVDoSUPpI60lhlgoh8zBH4WO Sx0cT/KvhNwa+5E8sGQXyaApF1DhX5Tss7bfimQN137yseYnQEUXbiBXq/CWNpUm1SFf Ip/hLKTP9FS6smZBx5z028zrvO8VHil55Myhym0DUpJ1Ov/wYi02aCOwK8YrBXfmUc/h q7uhBJXkjilvsy6rsonV7+n7qN0zgLE/t2297QbbyFefl0jmPF9wdViifY7mW25raYci /K8A== 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=LPKH1RUVJdvMtNgmkDeMmBeBEhsmqniwrmDsFWbcwuQ=; b=sZFzpTrGRH5zE0OrAbBWB2dkO048tV9cUQQJBWn5/+N/hgwFsp/rzFSZNoTSwKeZp9 OGNCpvlDlgzDLoh/W7ERg6JGyDPsCCeznRuTDtshrIRyCeqwDf+Yme2Pz9+8E3WV8KXh zdDKkJ2toKfA/RNo62L8jrO4mkPIcvm4/wqAUuLHDckWlg67hcyF7ZYMK3rk+HomAaZ8 aHEjL7GsqqHqY5VW4TsY6BYoSanmLKoF9OM76a6hU6qHcL3ZxJCpc0O6YnVNT9yOgmh6 pdcOB+QTVEi60L6S78KzC4rWqn6AiF23DItLuc/sFa4vFs2HEIhBUjX/hFQib0FWCLoN GOrA== 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 f4-20020a1709063f4400b00877a9863006si9843812ejj.282.2023.01.23.12.56.02; Mon, 23 Jan 2023 12:56:26 -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 S231981AbjAWUyR (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231652AbjAWUyF (ORCPT ); Mon, 23 Jan 2023 15:54:05 -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 3897C7DB5 for ; Mon, 23 Jan 2023 12:54:05 -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 1pK3pH-0000Lk-7J; Mon, 23 Jan 2023 21:53:59 +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 05/23] staging: r8188eu: simplify the sta loop in rtw_dequeue_xframe Date: Mon, 23 Jan 2023 21:53:24 +0100 Message-Id: <20230123205342.229589-6-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?1755848256632498318?= X-GMAIL-MSGID: =?utf-8?q?1755848256632498318?= Use list_for_each_entry_safe to iterate over the station entries in function rtw_dequeue_xframe instead of coding the loop manually. We have to use the safe version, the loop body may remove a station from the list over which we iterate. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 5f2426be6c11..b07a1ce21a38 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1377,9 +1377,9 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i) { - struct list_head *sta_plist, *sta_phead; + struct list_head *sta_phead; struct hw_xmit *phwxmit; - struct tx_servq *ptxservq = NULL; + struct tx_servq *ptxservq, *tmp_txservq; struct __queue *pframe_queue = NULL; struct xmit_frame *pxmitframe = NULL; struct adapter *padapter = pxmitpriv->adapter; @@ -1401,10 +1401,8 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi phwxmit = phwxmit_i + inx[i]; sta_phead = get_list_head(phwxmit->sta_queue); - sta_plist = sta_phead->next; - while (sta_phead != sta_plist) { - ptxservq = container_of(sta_plist, struct tx_servq, tx_pending); + list_for_each_entry_safe(ptxservq, tmp_txservq, sta_phead, tx_pending) { pframe_queue = &ptxservq->sta_pending; @@ -1418,8 +1416,6 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi list_del_init(&ptxservq->tx_pending); goto exit; } - - sta_plist = sta_plist->next; } } exit: From patchwork Mon Jan 23 20:53:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47386 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811171wrn; Mon, 23 Jan 2023 12:56:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXtDdj7dEbu0ICvMsROe9Au3sSgPERtU3V3GW2uLt/xtIK4N5231cmyymkrIg5cg9baX0pLc X-Received: by 2002:a17:907:7da0:b0:86d:67b0:6292 with SMTP id oz32-20020a1709077da000b0086d67b06292mr39558529ejc.73.1674507398741; Mon, 23 Jan 2023 12:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507398; cv=none; d=google.com; s=arc-20160816; b=vgv+gtDFBl3+7rdblTeBL2R/k7PMx5z5UihM4JRjaPlo/4nskexF2MeN830ppOCmqi C8B5iN2C2Fyytx3FUnenemy4MWX7WFFcRd2mN9zNHU0Nw5PKFTnH+p8AHdpVRS3aXed+ VZVCr0yN7mRsrc3w2P9L6YotXu06mMrCAP9V+/FMJJDpwkl/70N2wC9MFP7McHlmDcU8 ti7sDVp2uJBpE80L8xggQMnWvezeZZn80bKkuwIveDKHGOxD7Red9Zc+slyqS9r/1juT CD4hAnx6DE6wWy3ikTpF+BXOSpe4VE0E65zbcBJsEBK1rx++Hu13gx6nyqSkFMSrCBc1 BOng== 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=szs8S7KSXP1TOq+m4SYmaEQUvK++YtXkl0CkpnUhKv4=; b=AMOC5LDdVESRTJiWKokG9PTIhqacwRPKd0qYuAZ3/lj3IgbW6XAMm5DK5xdHu/55JP AmkIRmbC9kLCFLWJ+P44eFSucHDwdLRsb5+372OcdcTPmBlogjxeABUYmSOrt2XIRYGD 5hvcWJhbpOzlQcCheCJzTO8hZuGe9qKLTG5/DgytnmbiOFAQI8RmUB+qDYd5DYETXuTa cb/LkMqmMJgXPg4wOdy3WfQCRO44fTNtIQSp0barqlO5jG9RA2lDGGlaB0Kf2QSfqGbs dmurvle/MrYQpAG2R33O7YwxOpCvTZPNEjF+JXInQlh3/Dd9Eeu51rkzG73k69SB2pCb +idw== 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 s4-20020a17090699c400b008778924dd6csi14584228ejn.954.2023.01.23.12.56.14; Mon, 23 Jan 2023 12:56:38 -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 S232139AbjAWUyT (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231819AbjAWUyG (ORCPT ); Mon, 23 Jan 2023 15:54:06 -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 C982C23D9F for ; Mon, 23 Jan 2023 12:54:05 -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 1pK3pI-0000Lk-13; Mon, 23 Jan 2023 21:54:00 +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 06/23] staging: r8188eu: simplify the code to initialise inx Date: Mon, 23 Jan 2023 21:53:25 +0100 Message-Id: <20230123205342.229589-7-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?1755848270295705047?= X-GMAIL-MSGID: =?utf-8?q?1755848270295705047?= Simplify the code to initialise the inx array in function rtw_dequeue_xframe and make the code a tiny bit smaller. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index b07a1ce21a38..30bc9405356d 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1384,15 +1384,11 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi struct xmit_frame *pxmitframe = NULL; struct adapter *padapter = pxmitpriv->adapter; struct registry_priv *pregpriv = &padapter->registrypriv; - int i, inx[4]; - - inx[0] = 0; inx[1] = 1; inx[2] = 2; inx[3] = 3; + int i, inx[] = { 0, 1, 2, 3 }; if (pregpriv->wifi_spec == 1) { - int j; - - for (j = 0; j < 4; j++) - inx[j] = pxmitpriv->wmm_para_seq[j]; + for (i = 0; i < ARRAY_SIZE(inx); i++) + inx[i] = pxmitpriv->wmm_para_seq[i]; } spin_lock_bh(&pxmitpriv->lock); From patchwork Mon Jan 23 20:53:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47380 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811054wrn; Mon, 23 Jan 2023 12:56:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXsNNApFSp2JTsH4+90DiPMg+F5HPaZprLMkH56IVKcnTQWM1lXNJHqBLsWBlKIYPEwXyJjT X-Received: by 2002:a17:907:1dcd:b0:877:6288:eff2 with SMTP id og13-20020a1709071dcd00b008776288eff2mr21541381ejc.75.1674507379134; Mon, 23 Jan 2023 12:56:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507379; cv=none; d=google.com; s=arc-20160816; b=EY29JH1HvhwBCii2dOFPZpe1atJt5r2t8RqPx2EzYNQB5ja8SpKCZkyXgSwhPhdrzu MAR+LmILEEACTycpkTl6raGcX54ztl5woL0jB01F4vpf+gkHkbSp8porMton75fE5gqu SF50MqRiF+Y+I2HNYU+mSm4vP5XAFEsg/8eVWDArfNIGfnxcnH7oK8EBFu+4DLdxwA1b plITfodDUDfAx1jdtAT44UjoqU3lyjhGk3R+k0JW5OqtGqkaXo8eLdH7HEofl/gMFYh0 u4ACMAO1cL+1u3rrZ4TLmetUXrbXpibbA8l9pVplc9L+GEu2pZXGpwPLfq5zjLxWSogS O9Sg== 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=hIkdKqS972q1zcaiTOY1eWd5AbJsS+GWW9kMH/hcKBQ=; b=XLglrD+AeaXecwI8ZJxmOxs23ORgA4ATsZgDSzV1EWXx6KneCnk3hGIqo8y05j6wiB VkQObjG7Kw2kOnLKlVoJ7bLceZqDaDQrclfMtxtQxXGo7P3BggN9TjmzdolZDPAbirwJ jElBaJBRQE1JX2dHAMCX9CWAF9UHPxbVP7PimanG4s7rEPQ23FyS73Q59pIHlcT2UOE/ nsWc7ABx2NMSGbr2tt7EdAdoMPKUyGt6zWukyGLmFCGhwvxBQQHgTF9GEJvkt6YypPrG N6LP36SN3u5CO3fnizWC27ahJguLq+WDBqCvwOsPfXBSv7PFg69fe4QUAovTltS0vrJ0 7/DQ== 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 nd12-20020a170907628c00b007c14665652esi31508943ejc.299.2023.01.23.12.55.54; Mon, 23 Jan 2023 12:56:19 -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 S232196AbjAWUyX (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231855AbjAWUyH (ORCPT ); Mon, 23 Jan 2023 15:54:07 -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 A0EEA3525A for ; Mon, 23 Jan 2023 12:54:06 -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 1pK3pI-0000Lk-Pl; Mon, 23 Jan 2023 21:54:00 +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 07/23] staging: r8188eu: remove an obsolete comment Date: Mon, 23 Jan 2023 21:53:26 +0100 Message-Id: <20230123205342.229589-8-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?1755848249567916826?= X-GMAIL-MSGID: =?utf-8?q?1755848249567916826?= Remove an obsolete comment in rtw_dequeue_xframe. There is no break statement any more. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 30bc9405356d..a431bffbccf2 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1408,7 +1408,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi phwxmit->accnt--; /* Remove sta node when there are no pending packets. */ - if (list_empty(&pframe_queue->queue)) /* must be done after get_next and before break */ + if (list_empty(&pframe_queue->queue)) list_del_init(&ptxservq->tx_pending); goto exit; } From patchwork Mon Jan 23 20:53:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47391 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811206wrn; Mon, 23 Jan 2023 12:56:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXse/4cxCF2om0RH5BYoOH4gRJpnzHVf9kKfVfBWQzJ75BnV00xl4dG3Vf1drxylAOQh9HUe X-Received: by 2002:a17:906:2683:b0:7bd:43e9:d3ab with SMTP id t3-20020a170906268300b007bd43e9d3abmr22806561ejc.52.1674507405094; Mon, 23 Jan 2023 12:56:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507405; cv=none; d=google.com; s=arc-20160816; b=1FJ6aVpHx20k9xqvvoOSVp+LlBDw+Ljl10rVw3EGTca0mZP9ztqDcAsH4gnNeZs6lH ZQfzA4y3CGZ4sLhEAPBKzLAC5Z+6Rgamnf/dZzOIDimzpm/aHiYulyXYg4tbNE93ZUGy yWgFtNx88+C3mx7cYPAhSrrZiUz4f2CAqv2Y+Wvs6O5PI/OPi/U8ULHtET/K/SGK3hPh Qk0Swputw13ghKt1avFyY/rc5DQ2Ygv5ch020oblT4vumW5gYgT2h12LcOhLqcMu4x45 kawZlDDzEa8y5nSEmWvF3C2MwYiiq/XyRM5DGkKYzIOkfuUjCtuSEP61vLN3VFfDzEE7 DmJA== 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=vQy0qde/iCgz5Mbm3E6a6nzzNi5Psbj5h9Hi4kaO5Ys=; b=BQHvgjDy4X9ZmN+QaaDc3B/fub1A2DbGpOAEPWkj9tC/pzElLvVjpJdY1HGaf3piVd U1UlCGZ4wOsPe3f0PmkycceHZIRBoUmIYWiXOhsj4Zrq5BfjseCupkAflm8qvzqXJtdW 4sxrLZdGwL75IVIIuNOZBso24zQSJ5D6QUGHZwzShMNY3WasTNa/ieaoSzqON7z9MDeB 265++zvYohRRfUIExc38vjh8DuMb2D2dt4YyPE0dDoVdEhKllVcpGpehOGzUAWMrc/CD /PZTq65vWSoNSij6R6x+yKNUlkBme1RVh6k5XkXqW9z/AdIPMwQ0t/grgAA7Rz0NLiDT qWWA== 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 o16-20020a170906975000b0087783864543si18792935ejy.591.2023.01.23.12.56.18; Mon, 23 Jan 2023 12:56:45 -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 S231876AbjAWUyV (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231848AbjAWUyH (ORCPT ); Mon, 23 Jan 2023 15:54:07 -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 8CFFF32E70 for ; Mon, 23 Jan 2023 12:54:06 -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 1pK3pJ-0000Lk-Il; Mon, 23 Jan 2023 21:54:01 +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 08/23] staging: r8188eu: remove unused function parameter Date: Mon, 23 Jan 2023 21:53:27 +0100 Message-Id: <20230123205342.229589-9-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?1755848276959706553?= X-GMAIL-MSGID: =?utf-8?q?1755848276959706553?= The pxmitpriv parameter in function dequeue_one_xmitframe is not needed. It can be removed. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index a431bffbccf2..aefd32b98d08 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 xmit_priv *pxmitpriv, struct tx_servq *ptxservq, struct __queue *pframe_queue) +static struct xmit_frame *dequeue_one_xmitframe(struct tx_servq *ptxservq, struct __queue *pframe_queue) { struct list_head *xmitframe_plist, *xmitframe_phead; struct xmit_frame *pxmitframe = NULL; @@ -1402,7 +1402,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi pframe_queue = &ptxservq->sta_pending; - pxmitframe = dequeue_one_xmitframe(pxmitpriv, ptxservq, pframe_queue); + pxmitframe = dequeue_one_xmitframe(ptxservq, pframe_queue); if (pxmitframe) { phwxmit->accnt--; From patchwork Mon Jan 23 20:53:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47392 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811217wrn; Mon, 23 Jan 2023 12:56:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXvYxUG61eODvbD9IkJG1Rtx0pb+ltzzNgkxh/kV/ULnUatMpvNALytl3Qx7vh0lZJ77rAsB X-Received: by 2002:a50:fe95:0:b0:46c:aa8b:da5c with SMTP id d21-20020a50fe95000000b0046caa8bda5cmr25766265edt.33.1674507407301; Mon, 23 Jan 2023 12:56:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507407; cv=none; d=google.com; s=arc-20160816; b=AKsrPlL/8Jp3c11km0uVDdgKtcqgJAfvnLAGWo+/QmaDpadGXPzPswoN32VkY4xpH2 yE+Xv3A+WgChn3x0hEfRBI6zmbzXrfRtAl7PZCb8G0iYq4w5YCZ29vgFIW3z5qrRjgjl q7M/u8WoWmZeW9RnXhTeiGoH5DeQbcgqOwuI/nVXYPwaHk5nJzJUYuY5KyT8sqQVy3oe ZkjpPICo4Jxzy2wbeAlaPlxcxTwYncIrir3XkPTYY9MRAfs1ofywuBtHP5GbEfkCS8O2 9gYxIexvSB0dtNCALFjt5t3RvBTaXkSZ5Bjey0Sw39UYdTrZaqyJMUGN8E2Sna7C67Zr sYkg== 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=Nnw4kwTQpoH4M+oZ/jucfxzK9rPJmM8XkaO0HiD3qpc=; b=fUoxyQ6AKdi7gm6BkRPaS9A1PmCwcoaW3R0fPk7G+enwL05+Ot5kuE4giW1ku2CwmZ vzVOZlq2eJZ6VN0bPDU5FSARn4/QR1CSwAp4/TOWYFkxbp4oTpZJszn+qYS0htikiAB5 a7zQIhEaQQuYkog/Q/99fSQ35P2T0b93fTxoot6XoQ6tlj369iYAPLDBaAA+LyfNopXw MKBSnRdj1ajtviD0yNBq7C6ScTI3SJs4G2hMamuWs+pbm8uZL2z7+pSTlgG0E0Eo9CfI S56nuTXCiyXwM2nexrjjFcFZ/9EkHLuwiLYf2fQxlwzstTundJk5P4h5uMj4iBV1aIE/ UxaA== 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 v28-20020aa7cd5c000000b00469bac8510csi406794edw.583.2023.01.23.12.56.23; Mon, 23 Jan 2023 12:56:47 -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 S232207AbjAWUy0 (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:26 -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 S231803AbjAWUyI (ORCPT ); Mon, 23 Jan 2023 15:54:08 -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 857BE23D9F for ; Mon, 23 Jan 2023 12:54:07 -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 1pK3pK-0000Lk-C5; Mon, 23 Jan 2023 21:54:02 +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 09/23] staging: r8188eu: remove dead assignment Date: Mon, 23 Jan 2023 21:53:28 +0100 Message-Id: <20230123205342.229589-10-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?1755848278851341404?= X-GMAIL-MSGID: =?utf-8?q?1755848278851341404?= There's no point in moving xmitframe_plist to the next list element. xmitframe_plist is not used any more after this assignment. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index aefd32b98d08..943e7a56f7ce 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1365,11 +1365,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct tx_servq *ptxservq, struc if (xmitframe_phead != xmitframe_plist) { pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - - xmitframe_plist = xmitframe_plist->next; - list_del_init(&pxmitframe->list); - ptxservq->qcnt--; } return pxmitframe; From patchwork Mon Jan 23 20:53:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47384 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811122wrn; Mon, 23 Jan 2023 12:56:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXunbVHCjNhqrpeAzkwH5RuKjgkZOsmuFGlsXjE24aeS5RspOWQn/O0V8SIoHHhSMhc+QdqV X-Received: by 2002:a17:907:8999:b0:877:83ea:2bfc with SMTP id rr25-20020a170907899900b0087783ea2bfcmr16825399ejc.39.1674507391627; Mon, 23 Jan 2023 12:56:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507391; cv=none; d=google.com; s=arc-20160816; b=B5/oqDSXmMQRwPEKtv24Csbxv6n6Rhj1tuJlzVe2ZjLK2R6bqs+IyN/Y8s7864LA8c 2VgH+MmBaKkLrjWrlHOC9v8YTAFmIlZ3tuq8P8IN9WUHX1vlknMz9u9IuhNruU/PY0S0 EFG5OLLlwRQ1uiOIsmYmRFd8/UCxPV+YBawAq91THOijuk32MaewYrux6fTr4cfiONv/ cNi0s79AvIqE/8pMbriRtV78+FpENmdYy9AWub7m2Il6xT6Pu5jbLsQ+pKpmckT4kekj dDA7js4IDKqE1zTvwAapgGvFigaR9bjL2oMVhMgEkJ6Ml3/QqRWMR7tAOMs1PLX1Wlj2 GJXQ== 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=k0Nf1olp4DOhR/StLmx7p6i44RaXwagNYBeOjioqddI=; b=B7SQ0tg1Hx9X17BUX5/rAMEvatmyeRju636erGxwMChcx3pw8+/ifApZZsymeF4x73 SOHwczsiu//7bVlpbz5Gj0TchJ0VBUCtqWw/xCCHtmhYMWbWnxvXf56wIAYUilTdwle2 7t0c6jxB5swMrii5ejvioeBm/o7AvBTw2uyxwpanSHJJLWAlh52epQT1q2oFnSsTXC6f pM6FzI2/IbN3wvX09LIZlvxBcTqAxYhco/azYPdbQXwUbT6F/UUdDyJxeq6Q1cBhGTMC 97dC+hPqD4MFxRnKV5JAXv1uHJjxHPYYbjekG7McLuHQ1GJhrBWi3PtVIK5ZsIEE8HSJ WFGA== 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 e6-20020a17090658c600b007abafd4d7d0si60868619ejs.702.2023.01.23.12.56.07; Mon, 23 Jan 2023 12:56:31 -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 S232338AbjAWUyf (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231915AbjAWUyP (ORCPT ); Mon, 23 Jan 2023 15:54:15 -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 ED1CC38026 for ; Mon, 23 Jan 2023 12:54:12 -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 1pK3pL-0000Lk-7w; Mon, 23 Jan 2023 21:54:03 +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 10/23] staging: r8188eu: use list_empty Date: Mon, 23 Jan 2023 21:53:29 +0100 Message-Id: <20230123205342.229589-11-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?1755848262683163230?= X-GMAIL-MSGID: =?utf-8?q?1755848262683163230?= Use list_empty to check for an empty list instead of coding the check manually. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 943e7a56f7ce..334d75214011 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1363,7 +1363,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct tx_servq *ptxservq, struc xmitframe_phead = get_list_head(pframe_queue); xmitframe_plist = xmitframe_phead->next; - if (xmitframe_phead != xmitframe_plist) { + if (!list_empty(xmitframe_phead)) { pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); list_del_init(&pxmitframe->list); ptxservq->qcnt--; From patchwork Mon Jan 23 20:53:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47385 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811156wrn; Mon, 23 Jan 2023 12:56:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXvCmVZEf2aO403OQ8mZbjpMJoRLm00ybzim5XKVft8M+pAstbEipVYLZIiueyQaoRxsfFtH X-Received: by 2002:a05:6a20:1596:b0:b8:7905:b6c4 with SMTP id h22-20020a056a20159600b000b87905b6c4mr33399968pzj.61.1674507397110; Mon, 23 Jan 2023 12:56:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507397; cv=none; d=google.com; s=arc-20160816; b=qcMfha2tQ92S4UW7rFQNglc4/8E4pqcAsjhS/sui5wfWhTrfRGavNpgXgeaT1zdT2B 4ln0zrXvobIgCj91D7OhZhjG6Wyk9fxDF8pNGEdCTRf9WDfrYDksCO1nrbC7g5vySGPf EeRSZuhqrAmxuewO3N54ntH6wyBL2fLCZ0+lgXnS8Jl8NxGDoVMCtEmSp9lwelVMcSlv s1BIzVR67XOczTbpRDfziiA93n8Zc4qVMsYrVu5NLw9T7mBxcZzsQ67FSZ2NhnqpNP9a wQr8NbHcTXFKzdQnZHC+qr5pi1cINsG3IvH+rOGoWABas/+b5nvsEcWNhH4lvzu2IOIz SUqA== 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=vtezimfmRIuXCTWXgsRYwjBkmFE7xqsyfzFfPJYyr5g=; b=YAdDxmHwWAL92DzgUf+uTH3l4QEpmHHQ0/xXEaNccfxTvfkKgdriGHQ2EIkRxgzY9x T+FAahsdE3ciOcgYE4FMTQLQHl6rw7MA/V7B3WqM7ZvF7qkqxuBijd3q6hc1bdvKHQh7 qGh8tVpDBCfFR590y6hdI+whWpwdwquniFjxcxFBvkfosvoYZ8DkwMCPYDzM45QRBsct JeciENEEz7DTZZCPMaPDeuyd6Q2eb/a/h9LcIFPhFSUJz/INAsy4iihHZu/OphEuZsb6 wxUXAogGzlnxWq2f6pE06GwDOkikqDiuB6FH81a6Nckc1lH7W9LBxDkD1mk6NL717c+6 uAvg== 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 e1-20020a17090301c100b001945b3a1db5si351725plh.153.2023.01.23.12.56.24; Mon, 23 Jan 2023 12:56:37 -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 S232249AbjAWUy2 (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231795AbjAWUyN (ORCPT ); Mon, 23 Jan 2023 15:54:13 -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 EA6E525E38 for ; Mon, 23 Jan 2023 12:54:09 -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 1pK3pM-0000Lk-1E; Mon, 23 Jan 2023 21:54:04 +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 11/23] staging: r8188eu: simplify dequeue_one_xmitframe Date: Mon, 23 Jan 2023 21:53:30 +0100 Message-Id: <20230123205342.229589-12-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?1755848268331335296?= X-GMAIL-MSGID: =?utf-8?q?1755848268331335296?= Revert the if condition and exit immediately if the list of xmitframes is empty. Hopefully, this makes the code a little bit simpler. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 334d75214011..96079d9a6c42 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1358,16 +1358,16 @@ s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitfram static struct xmit_frame *dequeue_one_xmitframe(struct tx_servq *ptxservq, struct __queue *pframe_queue) { struct list_head *xmitframe_plist, *xmitframe_phead; - struct xmit_frame *pxmitframe = NULL; + struct xmit_frame *pxmitframe; xmitframe_phead = get_list_head(pframe_queue); - xmitframe_plist = xmitframe_phead->next; + if (list_empty(xmitframe_phead)) + return NULL; - if (!list_empty(xmitframe_phead)) { - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); - list_del_init(&pxmitframe->list); - ptxservq->qcnt--; - } + xmitframe_plist = xmitframe_phead->next; + pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); + list_del_init(&pxmitframe->list); + ptxservq->qcnt--; return pxmitframe; } From patchwork Mon Jan 23 20:53:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47388 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811192wrn; Mon, 23 Jan 2023 12:56:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXuXNczUBzMjN52XhQ+wBa5NZIeWfr6VHwbmw7Ek0wzdc812Acqc39E5OenEuesORSM8+VXf X-Received: by 2002:a62:ea0e:0:b0:577:d10d:6eab with SMTP id t14-20020a62ea0e000000b00577d10d6eabmr26964949pfh.21.1674507401908; Mon, 23 Jan 2023 12:56:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507401; cv=none; d=google.com; s=arc-20160816; b=iv7r51rgrcdNhFAjCiDoBhGxw4aNFmrpkXPu2MUgf88Ci7uTeBRAvrQgvqZUZm/Xy6 t0XN1bw5y+gALk5dl2dxFNKGpar7PEFONqLjg/In/5s2bz/tf5LsNGpLklp1Wm+4sq1g 3mWZuQURVVD26auCn3LSgFZQX2dfpRljgZsAWMfklNxswJAlt40WnLjj7gIO7+vgdsEF fiSv0w1oCyTPL+Cc2yZL2IzOflAUBheVlUg+EtC5QQ1o+kKSSG8d4q1VcjKRg/PkYKk2 VzPyZVC8ildODo8H0kSNsBneHogpu8kR/4CgVgWnf6rAg/fX88pPHyl7lc+btd1bDHPR pRlg== 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=x6mRKQmWAKQfD5kKOdygoZ+n5giR/h/TABoJAkvwiSI=; b=pqgmYm9JrGzR0dKcq+Q/cpCJvJuaIPD47e2o3uxj4H9qitmLxjI3VVOtU2eCO3qSm0 ogO6fRLMmboJfEGV76ykGVb7vu/8H7+iBSPMMDkLKllTHoH0ObWOZqN9sQoJoC442rYW 8ZRX7lBnrsEhpdih5FBY0sxPfaBiaNYTkTJBkpmXf6Aa5wGzzxuZzhMyjClG8XAI90kX MhGIbtUX4bLxiUtZx0CNK7zSF7SS48rnboRZuuGDDrZG0HllqBeWE5xwWtTvRPzi6uSH ex4osDGKJZv19PNW7RSO+OWRv+uKMUbaXXd7dQ4f0GeSd15FvaCLyLzO1djqTSwOx/Qe wnEw== 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 k8-20020aa79d08000000b00580ccf54452si54057pfp.295.2023.01.23.12.56.30; Mon, 23 Jan 2023 12:56:41 -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 S232049AbjAWUyb (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232016AbjAWUyO (ORCPT ); Mon, 23 Jan 2023 15:54:14 -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 A121732E64 for ; Mon, 23 Jan 2023 12:54:10 -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 1pK3pM-0000Lk-P5; Mon, 23 Jan 2023 21:54:04 +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 12/23] staging: r8188eu: remove redundant parameter Date: Mon, 23 Jan 2023 21:53:31 +0100 Message-Id: <20230123205342.229589-13-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?1755848273692571852?= X-GMAIL-MSGID: =?utf-8?q?1755848273692571852?= The rtl8188eu_xmitframe_complete function takes two parameters: adapter and xmit_priv. xmit_priv is part of struct adapter, this parameter can be removed. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 3 ++- drivers/staging/r8188eu/hal/usb_ops_linux.c | 3 +-- drivers/staging/r8188eu/include/rtl8188e_xmit.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c index e097fa14dc6e..e067cc271686 100644 --- a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +++ b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c @@ -365,8 +365,9 @@ static u32 xmitframe_need_length(struct xmit_frame *pxmitframe) return len; } -bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitpriv) +bool rtl8188eu_xmitframe_complete(struct adapter *adapt) { + struct xmit_priv *pxmitpriv = &adapt->xmitpriv; struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapt); struct xmit_frame *pxmitframe = NULL; struct xmit_frame *pfirstframe = NULL; diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c index 9f008e61a6f2..e122c8ca929c 100644 --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c @@ -463,7 +463,6 @@ u32 rtw_read_port(struct adapter *adapter, u8 *rmem) void rtl8188eu_xmit_tasklet(unsigned long priv) { struct adapter *adapt = (struct adapter *)priv; - struct xmit_priv *pxmitpriv = &adapt->xmitpriv; if (check_fwstate(&adapt->mlmepriv, _FW_UNDER_SURVEY)) return; @@ -471,5 +470,5 @@ void rtl8188eu_xmit_tasklet(unsigned long priv) do { if (adapt->bDriverStopped || adapt->bSurpriseRemoved || adapt->bWritePortCancel) break; - } while (rtl8188eu_xmitframe_complete(adapt, pxmitpriv)); + } while (rtl8188eu_xmitframe_complete(adapt)); } diff --git a/drivers/staging/r8188eu/include/rtl8188e_xmit.h b/drivers/staging/r8188eu/include/rtl8188e_xmit.h index e6d343ffc148..a023dd792da7 100644 --- a/drivers/staging/r8188eu/include/rtl8188e_xmit.h +++ b/drivers/staging/r8188eu/include/rtl8188e_xmit.h @@ -125,7 +125,6 @@ s32 rtl8188eu_hal_xmit(struct adapter *padapter, struct xmit_frame *frame); s32 rtl8188eu_mgnt_xmit(struct adapter *padapter, struct xmit_frame *frame); s32 rtl8188eu_xmit_buf_handler(struct adapter *padapter); void rtl8188eu_xmit_tasklet(unsigned long priv); -bool rtl8188eu_xmitframe_complete(struct adapter *padapter, - struct xmit_priv *pxmitpriv); +bool rtl8188eu_xmitframe_complete(struct adapter *padapter); #endif /* __RTL8188E_XMIT_H__ */ From patchwork Mon Jan 23 20:53:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47393 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811220wrn; Mon, 23 Jan 2023 12:56:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXt1r9iUAHi9dfjITRoiCCYqT+vXEpVhHfrieDCRu1YiUYjfHzQiYD+DxM1uVG6ATBrmn4Yf X-Received: by 2002:a05:6a20:6a92:b0:b8:7ef5:4308 with SMTP id bi18-20020a056a206a9200b000b87ef54308mr24591942pzb.23.1674507408108; Mon, 23 Jan 2023 12:56:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507408; cv=none; d=google.com; s=arc-20160816; b=NRr4fYkzG6vIPiTAIZ5E0wn8ToKBKKTv1OjISJCqzGUbJ9i32i9CqYt6LS/fxRCaR0 o1dtuZaCkt4fNrmI8JjV/KzTUyO2COKhLek056J5Fuq3UKF4YZkGn1RVsqZHx21LQDm2 mfMSNHA90KKBXKwS5tvbXN0wWuoeTLBsh5TY7iGaslk8F5sfdltgSzo52p0zd+VuYHOs JBeCn1j73VHL0mWxuCfNPqfsB4hUe4qfnHRPJLed/t2rnS2d5rXMiRbN9QI/SlZ6NXFu puNHK9VuESot10U9gBMaMlHAFuZ2AoPiq5VqcdYD3pmukciEKpBC1IN//q+TJzvGzkpq xOTg== 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=gIfxpUx4ShmJTqgUpEyNp5jIpKtGczbk1oX++51Ybvo=; b=r4PoAmwT+rFLRMmBODt/3GeecT2Tsw5yTDRsVZPJvosQDzlbUvV3KxatBbAVmJ7O+8 MpSa3fVQQ9oHbKv9tNFCX0laqWscCPz4dfsqzFIAGI+YbA69sEiUiEZzKEeVzqWvBOQY bNctWTRSFuOIP/sJj9ZApAtBr/3zab1shawhOdnDEAc2gBhvnpKMbd375UDGqGKNM5Iq DhjmLSPEZNy7zEVoEYXioq/T2YspJaabkJCBhh7yEDnWKVQJBRIsX9yLnKixRaYhnSiT z7XszZ/JMVgaZeLVwkVPt66oJvgd46ujBei5S/zSukTYCqoKec9aNpGtbIm0tkFWit1p 9llQ== 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 e129-20020a636987000000b0046b3ba2c806si20360608pgc.145.2023.01.23.12.56.35; Mon, 23 Jan 2023 12:56:48 -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 S232312AbjAWUyc (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232029AbjAWUyO (ORCPT ); Mon, 23 Jan 2023 15:54:14 -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 AA8DE36085 for ; Mon, 23 Jan 2023 12:54:11 -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 1pK3pN-0000Lk-GG; Mon, 23 Jan 2023 21:54:05 +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 13/23] staging: r8188eu: make rtw_chk_hi_queue_cmd a void function Date: Mon, 23 Jan 2023 21:53:32 +0100 Message-Id: <20230123205342.229589-14-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?1755848279854021855?= X-GMAIL-MSGID: =?utf-8?q?1755848279854021855?= Both callers of rtw_chk_hi_queue_cmd do not check the return value. Convert rtw_chk_hi_queue_cmd to a void function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_cmd.c | 16 +++++----------- drivers/staging/r8188eu/include/rtw_cmd.h | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c index eb79435da355..d57360a68fb3 100644 --- a/drivers/staging/r8188eu/core/rtw_cmd.c +++ b/drivers/staging/r8188eu/core/rtw_cmd.c @@ -1197,24 +1197,20 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter) } } -u8 rtw_chk_hi_queue_cmd(struct adapter *padapter) +void rtw_chk_hi_queue_cmd(struct adapter *padapter) { struct cmd_obj *ph2c; struct drvextra_cmd_parm *pdrvextra_cmd_parm; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; - u8 res = _SUCCESS; ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC); - if (!ph2c) { - res = _FAIL; - goto exit; - } + if (!ph2c) + return; pdrvextra_cmd_parm = kzalloc(sizeof(*pdrvextra_cmd_parm), GFP_ATOMIC); if (!pdrvextra_cmd_parm) { kfree(ph2c); - res = _FAIL; - goto exit; + return; } pdrvextra_cmd_parm->ec_id = CHECK_HIQ_WK_CID; @@ -1223,9 +1219,7 @@ u8 rtw_chk_hi_queue_cmd(struct adapter *padapter) init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); - res = rtw_enqueue_cmd(pcmdpriv, ph2c); -exit: - return res; + rtw_enqueue_cmd(pcmdpriv, ph2c); } u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt) diff --git a/drivers/staging/r8188eu/include/rtw_cmd.h b/drivers/staging/r8188eu/include/rtw_cmd.h index 9df7d4bf441d..e8eecd52d1d8 100644 --- a/drivers/staging/r8188eu/include/rtw_cmd.h +++ b/drivers/staging/r8188eu/include/rtw_cmd.h @@ -743,7 +743,7 @@ u8 rtw_rpt_timer_cfg_cmd(struct adapter *padapter, u16 minRptTime); u8 rtw_antenna_select_cmd(struct adapter *padapter, u8 antenna, u8 enqueue); u8 rtw_ps_cmd(struct adapter *padapter); -u8 rtw_chk_hi_queue_cmd(struct adapter *padapter); +void rtw_chk_hi_queue_cmd(struct adapter *padapter); u8 rtw_set_chplan_cmd(struct adapter *padapter, u8 chplan); 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)) From patchwork Mon Jan 23 20:53:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47389 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811200wrn; Mon, 23 Jan 2023 12:56:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXsUxE9pu0NfQPBiIe+jkDRz4EfVYH/nl4NOVtShIHOiDonfYtNSp1m7nyKFIHdsPgUcC7EV X-Received: by 2002:a05:6a21:150d:b0:b9:38e7:8738 with SMTP id nq13-20020a056a21150d00b000b938e78738mr18077911pzb.21.1674507403194; 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=mqJLFctQa0F7rBW0ilmKtZhV9KDKFFTiiSLQjfB6gDforE8MdQXQM3YHsKf7gZ8ng8 c6QJyU+iTgTc4FYvwd1f46Qdp7+zJQ2VSpdH7VksfTfu7Eo2xONpH60Js/KfFv+v8zWN sAwSKbA18T9cldn5XDrcoGH/u9lQ9qaTHWcDNY+UAETteKUzo5OncQT4gJqT+AZaVeif G/phgIetNdo5GLjf0IkhbbhDlufdjpsYT/Z23YbiNO2LJmtMT1aD9KkDpqqkZl6awSCj plKbGtx0HJga6i2PDBqdGvTZ/PIKqyPHirHLAYKwew8fmHXa5fIWTYfhjDmhbGJft0Jp 08fw== 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=qkTKK8529QWmM6BtfKyu3oDx4iopKOOvU2/2Tt87adE=; b=XX8+BuvJa++1cvr6IyVSL+ODQI/U6tVX2GgvKmilJEUWENadR6sycblJ9QYNJyEuee cvB3oCl6zTofvjsahrLiJmsxZm1tqlkDET8lit8Zw8dyCKrmzSZNZqA0z7AnoZqlfey1 teGvkDq5dahImSvvflJqqrIbZJkJ8Et/B3e4xSUqH9r899WiIgBtIOA1ky5XODyCfJGB pfuGjn74AneLQUNnCH5Nd+H2PpZ7yr8gfhaOQ54KjtVT/wjDc9oUw9grCeVaFWctXsDF HgpuyVsWdd5E7kq9Nz7g8N3JNpFvPN6jRaCzSQEpPMuG+bpPFFc+NoPlmf9omTQVd7Fy 0JZw== 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 c4-20020a17090a8d0400b00229125f1426si13543116pjo.19.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 S230040AbjAWUy5 (ORCPT + 99 others); Mon, 23 Jan 2023 15:54:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232159AbjAWUyU (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 E0A9837F00 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-VQ; 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 15/23] staging: r8188eu: simplify dequeue_one_xmitframe Date: Mon, 23 Jan 2023 21:53:34 +0100 Message-Id: <20230123205342.229589-16-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?1755848268331335296?= X-GMAIL-MSGID: =?utf-8?q?1755848274554938431?= Simplify the dequeue_one_xmitframe function without changing its behaviour. Drop the temporary variable xmitframe_plist. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 7802a34ebcfd..79a1999ca809 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1357,15 +1357,13 @@ s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitfram static struct xmit_frame *dequeue_one_xmitframe(struct __queue *pframe_queue) { - struct list_head *xmitframe_plist, *xmitframe_phead; + struct list_head *xmitframe_phead = get_list_head(pframe_queue); struct xmit_frame *pxmitframe; - xmitframe_phead = get_list_head(pframe_queue); if (list_empty(xmitframe_phead)) return NULL; - xmitframe_plist = xmitframe_phead->next; - pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list); + pxmitframe = container_of(xmitframe_phead->next, struct xmit_frame, list); list_del_init(&pxmitframe->list); return pxmitframe; } 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; } 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: From patchwork Mon Jan 23 20:53:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47402 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1812032wrn; Mon, 23 Jan 2023 12:59:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXvpdZIvkpAZA0vW/rriEJysqT+MP0odRKDVB2HoB/vpfGAT36yUy0dJDW3mEEnABnfra5+i X-Received: by 2002:a17:902:edd1:b0:194:6415:ced0 with SMTP id q17-20020a170902edd100b001946415ced0mr23786633plk.15.1674507561140; Mon, 23 Jan 2023 12:59:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507561; cv=none; d=google.com; s=arc-20160816; b=s31fy7izT5vnj7u2W51Npk+2M5npiBdO/WUKUGc0k/rp2SP6RXd6Hnpw8hriFaddsS jrdmVDdSdO4KxFDB1XgfEBetLrR3Stos6pwH3pXjVAk9NLgmfIs9XGXZXy4i2LdjnPFx ZpPFIIYwgI5qy0sM6ggg0s/RgiYOSP8aqxafUvfnUCh8AeNZmd2S5Fb7KzbE303+FzLF Vs5OnPk4vFFjy2yke4d+XfgRZOOUNrnwH5hJka9HV194D4Psy4RG9zqM/+dSB7ZuyWvF Z/bDWivh9+3hyTJntqDP8LZwlj6wYvO4rJRncSRDvL0JKesroV62Clz5lou2ckiNc/u5 wKxA== 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=JRGZcP4aPo6IfkterV50tOqogqRU0duXauithXsNluU=; b=J72d/U2PDK/vkIjMaiIjP0Z6Wye8NqJB0M37igo+eXiuAOg4g/qW2bZybh9k7ERVgo fQRSBNmXnVJB90al5YYyhrtkBd3ayL3AK6lAswrecaQiDvOBTVwEag4xcNbAfFi3p8/B 4SndjVTYw7qCGPNqMYo2X1iTUbTqmaKpOYjxF1nZmkq2nwOwQ/L+GUR/n+3FerFfWJbu tPVOUiwcgNkiPltR3ZD5hMS4myA8FfbwUuMAOIzkjfZL1xQQJ7iaAihtfEWZECkloeV0 hYmV4X8UepmOjX5FiYz2kwV+o5HkReKbRPOityhP8z55H5BHVOf5o48N0QkBiUWBcVpG qehg== 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 k13-20020a170902c40d00b0018948b0082fsi429690plk.244.2023.01.23.12.59.08; Mon, 23 Jan 2023 12:59:21 -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 S232399AbjAWUzL (ORCPT + 99 others); Mon, 23 Jan 2023 15:55:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232088AbjAWUyi (ORCPT ); Mon, 23 Jan 2023 15:54:38 -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 4CB5A38650 for ; Mon, 23 Jan 2023 12:54:15 -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 1pK3pR-0000Lk-AX; Mon, 23 Jan 2023 21:54:09 +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 18/23] staging: r8188eu: use lists for hwxmits Date: Mon, 23 Jan 2023 21:53:37 +0100 Message-Id: <20230123205342.229589-19-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?1755848440667740719?= X-GMAIL-MSGID: =?utf-8?q?1755848440667740719?= struct hw_xmit's sta_list points to one of vo, vi, be or bk_pending in struct xmit_priv. All of these are defined as struct __queue, which is a list plus a spinlock. For these components, the spinlock is unused, we need only the list. This patch converts sta_list and vo, vi, be and bk_pending to struct list_head. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 32 ++++++++++------------ drivers/staging/r8188eu/include/rtw_xmit.h | 10 +++---- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index cb0d8346ac10..ef6d3a9bffea 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -76,10 +76,10 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitpriv->adapter = padapter; - rtw_init_queue(&pxmitpriv->be_pending); - rtw_init_queue(&pxmitpriv->bk_pending); - rtw_init_queue(&pxmitpriv->vi_pending); - rtw_init_queue(&pxmitpriv->vo_pending); + INIT_LIST_HEAD(&pxmitpriv->be_pending); + INIT_LIST_HEAD(&pxmitpriv->bk_pending); + INIT_LIST_HEAD(&pxmitpriv->vi_pending); + INIT_LIST_HEAD(&pxmitpriv->vo_pending); rtw_init_queue(&pxmitpriv->free_xmit_queue); @@ -881,10 +881,10 @@ s32 rtw_txframes_pending(struct adapter *padapter) { struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - return (!list_empty(&pxmitpriv->be_pending.queue) || - !list_empty(&pxmitpriv->bk_pending.queue) || - !list_empty(&pxmitpriv->vi_pending.queue) || - !list_empty(&pxmitpriv->vo_pending.queue)); + return (!list_empty(&pxmitpriv->be_pending) || + !list_empty(&pxmitpriv->bk_pending) || + !list_empty(&pxmitpriv->vi_pending) || + !list_empty(&pxmitpriv->vo_pending)); } s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, struct pkt_attrib *pattrib) @@ -1357,7 +1357,6 @@ s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitfram struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i) { - struct list_head *sta_phead; struct hw_xmit *phwxmit; struct tx_servq *ptxservq, *tmp_txservq; struct list_head *xframe_list; @@ -1375,10 +1374,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi for (i = 0; i < HWXMIT_ENTRY; i++) { phwxmit = phwxmit_i + inx[i]; - - sta_phead = get_list_head(phwxmit->sta_queue); - - list_for_each_entry_safe(ptxservq, tmp_txservq, sta_phead, tx_pending) { + list_for_each_entry_safe(ptxservq, tmp_txservq, phwxmit->sta_list, tx_pending) { xframe_list = get_list_head(&ptxservq->sta_pending); if (list_empty(xframe_list)) continue; @@ -1460,7 +1456,7 @@ s32 rtw_xmit_classifier(struct adapter *padapter, struct xmit_frame *pxmitframe) ptxservq = rtw_get_sta_pending(padapter, psta, pattrib->priority, (u8 *)(&ac_index)); if (list_empty(&ptxservq->tx_pending)) - list_add_tail(&ptxservq->tx_pending, get_list_head(phwxmits[ac_index].sta_queue)); + list_add_tail(&ptxservq->tx_pending, phwxmits[ac_index].sta_list); list_add_tail(&pxmitframe->list, get_list_head(&ptxservq->sta_pending)); ptxservq->qcnt++; @@ -1481,10 +1477,10 @@ int rtw_alloc_hwxmits(struct adapter *padapter) hwxmits = pxmitpriv->hwxmits; - hwxmits[0].sta_queue = &pxmitpriv->vo_pending; - hwxmits[1].sta_queue = &pxmitpriv->vi_pending; - hwxmits[2].sta_queue = &pxmitpriv->be_pending; - hwxmits[3].sta_queue = &pxmitpriv->bk_pending; + hwxmits[0].sta_list = &pxmitpriv->vo_pending; + hwxmits[1].sta_list = &pxmitpriv->vi_pending; + hwxmits[2].sta_list = &pxmitpriv->be_pending; + hwxmits[3].sta_list = &pxmitpriv->bk_pending; return 0; } diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index cc32167fb4dc..30f8000120b2 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -97,7 +97,7 @@ union txdesc { }; struct hw_xmit { - struct __queue *sta_queue; + struct list_head *sta_list; int accnt; }; @@ -257,10 +257,10 @@ struct agg_pkt_info { struct xmit_priv { spinlock_t lock; - struct __queue be_pending; - struct __queue bk_pending; - struct __queue vi_pending; - struct __queue vo_pending; + struct list_head be_pending; + struct list_head bk_pending; + struct list_head vi_pending; + struct list_head vo_pending; u8 *pallocated_frame_buf; u8 *pxmit_frame_buf; uint free_xmitframe_cnt; From patchwork Mon Jan 23 20:53:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47394 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811286wrn; Mon, 23 Jan 2023 12:57:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXuxBV/iSJbRG275BY08LZw600akJywGg0bqxy0/pOb9h1IgodWyjSABNMmrT0SjFAuPQjip X-Received: by 2002:a17:903:2441:b0:194:4483:bff6 with SMTP id l1-20020a170903244100b001944483bff6mr38503203pls.68.1674507421859; Mon, 23 Jan 2023 12:57:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507421; cv=none; d=google.com; s=arc-20160816; b=tPHM3eYJAQuwGEFSdyRWQPksJYMPdr2U4Sq49Hytm+3iZuMRWPV3175w1EziP07eir 65wXUAm9aMlk3d8Sgu8/r9z8BCCQUBQb8rfGe0KaVx8lUud1iV2xtVyuol7bK2Buz7sQ FTCciZbWCLtRz3g01xELnH3MAA42z9hLKvxJPAx6JWJMSXwt7E0rw28TUBcQuErrpdnx WkmdEPuX+KAPJUq5pMgDUKCKsVfP7DiaALwDkJomzYqJnHCjsDDn2ZfOZf3jrbv+V0Wd 0zTsxl/3oEzy/LdjEOSykp/0o84ygGg07S86Ti9swSngQ7Zc997M67w+lYKYtZwBamxj QW3A== 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=id3Zx91zpyqs/o8JYs3wETC2mf5DX3qmuXDj3b4uauE=; b=q9f8p5Ul6mFZXovzrKuO+DHBfJAAyecjRQUs0LvUOnvpsm1rkwmzrnxdmSmwyNSXaV BGb3yWXhz1oCQ/WzF377mPRwDk6cUR6IquJtJzVSTCPd4z/LX3q047gc0ey3Ncxy+tI4 JRjV2u18dwGvgvam/Gy2Rr8xksTp49aoTETI7PoHaDNu3alp3HL17Mraq1uZSF8Mo3Ye 9RQ2vHP8DU7GZ9AKY0GlinD9eERGnSEizSkWEZ1tEIi/zU3MCNH4l/zk+QK6hYeP8j2U jN8oWzgFfk7oEaD0wqwvMqrNdWaMXD7I8BnrsvPn9rP1+Fbjq1eS9DSgdlUhfgp4NyxD 78zw== 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 h10-20020a170902704a00b00194c5d92df3si386991plt.50.2023.01.23.12.56.49; Mon, 23 Jan 2023 12:57:01 -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 S232255AbjAWUzI (ORCPT + 99 others); Mon, 23 Jan 2023 15:55:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232284AbjAWUy2 (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 2E12838648 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 1pK3pS-0000Lk-3s; Mon, 23 Jan 2023 21:54:10 +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 19/23] staging: r8188eu: fix rtw_xmitframe_enqueue error handling Date: Mon, 23 Jan 2023 21:53:38 +0100 Message-Id: <20230123205342.229589-20-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?1755848294585596631?= X-GMAIL-MSGID: =?utf-8?q?1755848294585596631?= In function rtw_xmitframe_enqueue, we can simply relay the error code from rtw_xmit_classifier. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index ef6d3a9bffea..4f9defdbe257 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1347,12 +1347,7 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pfram s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitframe) { - if (rtw_xmit_classifier(padapter, pxmitframe) == _FAIL) { -/* pxmitframe->pkt = NULL; */ - return _FAIL; - } - - return _SUCCESS; + return rtw_xmit_classifier(padapter, pxmitframe); } struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i) From patchwork Mon Jan 23 20:53:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47397 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811823wrn; Mon, 23 Jan 2023 12:58:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXsDlOeoOdf8ghyKZaHgPwtRlgVJeXNxkQx7ZxIAG5zYmimZCA9icgcW8Yn9PAgVNIDizoAw X-Received: by 2002:a17:902:c10d:b0:194:4986:a3db with SMTP id 13-20020a170902c10d00b001944986a3dbmr27526159pli.36.1674507529191; Mon, 23 Jan 2023 12:58:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507529; cv=none; d=google.com; s=arc-20160816; b=onD4MywJ2fO4s88E7M0ftav82AGn6DvB4JWIfANqaZca+UthZ+TqykOehs4XmV7rQy 0F/yMUyNP+pjfraGaIVN3gGDv2Fzxkmd86I+GpK4faXJHR+5+3HqirM1iicA/I97SClZ CFyBn2SKe3MZt2SUK8Zb0Do1wEADrwGVjw6nP4Cmn+AxFSdQjBUktAxwHFGiNDlLV7aA stRc1Lsi2sv2XFRBD/scVazqaFmwXWqHjT9qW+lpNiM+ORsi0PAGBorhFzmZPtGxeXi4 k9SS0xObyl3OoEyIZHaDjt7Lj4OQUkAAzIslniAxWrek0IRH/gAhSm0HDnffu2lC3Yjs ZmaQ== 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=2jgZ6pkYBeD1DIdt8l5Ns3z4OkE8tlHpVe/Zwxn1sUM=; b=oJutekIxD/AXKDZQJ6sz4PQT5i0KutDXn0JbP+s8m10C1GrHWJq3nqgSqCxilJluPm cPdkZ5gS7TVxRTWwO+DbTPbL3AcvdQARcNC8rKsfM3EpcxOjnQ8reC+UT/Y9NHmslK7M 03GYwKn5jkcz6fJtIS9jhq/vn0CU4IfzDExx1e+8EtzHhL690zaCdeq7AaflD4kuxBjH aqBksfJhbBu6Ssc5DfKedUedQBZPWtDTeX8rxLR+4hc4PqV5ujK4qcKstQqvQKgCew6+ XQeh4GggcR/eyNuv+u3qvplS5AAPLKznH0jaR18ity9lhqrgsRnzPP5kUIW38f5VvLP6 nk3w== 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 k16-20020a170902c41000b0017f75654a51si439966plk.245.2023.01.23.12.58.36; Mon, 23 Jan 2023 12:58:49 -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 S232314AbjAWU6B (ORCPT + 99 others); Mon, 23 Jan 2023 15:58:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232322AbjAWU5y (ORCPT ); Mon, 23 Jan 2023 15:57:54 -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 57D0538B4A for ; Mon, 23 Jan 2023 12:57:36 -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 1pK3pS-0000Lk-Rp; Mon, 23 Jan 2023 21:54:10 +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 20/23] staging: r8188eu: remove rtw_xmitframe_enqueue Date: Mon, 23 Jan 2023 21:53:39 +0100 Message-Id: <20230123205342.229589-21-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?1755848406421239396?= X-GMAIL-MSGID: =?utf-8?q?1755848406421239396?= The rtw_xmitframe_enqueue function is only one line. We can remove it and call rtw_xmit_classifier directly. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 5 ----- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 2 +- drivers/staging/r8188eu/include/rtw_xmit.h | 2 -- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 4f9defdbe257..3752d4fddd11 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1345,11 +1345,6 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pfram spin_unlock_bh(&pframequeue->lock); } -s32 rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitframe) -{ - return rtw_xmit_classifier(padapter, pxmitframe); -} - struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i) { struct hw_xmit *phwxmit; diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c index e067cc271686..18557738dbad 100644 --- a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +++ b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c @@ -596,7 +596,7 @@ static s32 pre_xmitframe(struct adapter *adapt, struct xmit_frame *pxmitframe) return true; enqueue: - res = rtw_xmitframe_enqueue(adapt, pxmitframe); + res = rtw_xmit_classifier(adapt, pxmitframe); spin_unlock_bh(&pxmitpriv->lock); if (res != _SUCCESS) { diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index 30f8000120b2..4aa7833487c8 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -320,8 +320,6 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pframequeue); struct tx_servq *rtw_get_sta_pending(struct adapter *padapter, struct sta_info *psta, int up, u8 *ac); -s32 rtw_xmitframe_enqueue(struct adapter *padapter, - struct xmit_frame *pxmitframe); struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i); From patchwork Mon Jan 23 20:53:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47414 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1828471wrn; Mon, 23 Jan 2023 13:42:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXt9EYF8e9PbypC12FJJjgYOpW2yjSKVBxEoaFlpy1DcXvTn77TdNbX8N92RT6gup7YaDAqd X-Received: by 2002:a05:6a20:ba92:b0:b8:c300:c813 with SMTP id fb18-20020a056a20ba9200b000b8c300c813mr25295800pzb.12.1674510166382; Mon, 23 Jan 2023 13:42:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674510166; cv=none; d=google.com; s=arc-20160816; b=NKgFVf3978BGrJQdb4/XP4TpKDgO/NjMEGZkpB11LSPSVINJ7yyL/ZtzWySZGnV5Tw DS/Yp7i/TvFlLLL8wsP1e+Qh/YA0aSMq8FXS+v5jhjW8KoP4tz2EDwlNZUp9fQZgGupY yEyUIWBzvmWKdcNQOmgt4VXTMo8CWl4Z2pS5Kk63Kpw/Mt3uBzVTDUng4QOUZpoQvLF9 Roop6w1yWIQ5ckVF5ZsI4ujNfSLzKrbpLE1q+fUiYoAmU91dnRIbDomDWK2L42l3V02l Tr+OEuD3hnc2OtMZiNddafabfeJy5AnMwjGvZK7MR1K179wrhRbPAXtBuRepGVJ9ebdn tqSA== 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=YaNpcS8ounPrUOM8MZXKZc7hKIoaiEe4a85PkH0uxOQ=; b=JFn7MisBFs+G/X9Sioo4takign4LOB1t9TlmLCVvqCGVetByNYW33c7CqjGrZvOcPk fIgW+Eqdey7bUvLcZ5mHO7DdmqZdH0O1UH+9G1bySVHCV6CEd1vQnWsvGnx71Y0BqVe6 11xidxzXG0oxWBUkyCGI5QcHJ0WhqQEaiAdZl8VS/XnlaaU8Ro8s0F+IOo+Y68ejmeFW 09ZuAM4AFLPKLVJ9sh6cmj6D7w8kb0GpGrQ/fLbpWV/6Bbdt7X8h7Ed+kzRz11obIIcs /akdZDr51GToLK8n3PQr5i1nPE2TBzDPf14fkNOuoz0xUDizxmHe1DOkmdRFOW54LwY0 hffA== 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 z19-20020a62d113000000b0058daeba6fcesi144639pfg.307.2023.01.23.13.42.32; Mon, 23 Jan 2023 13:42:46 -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 S232747AbjAWU7H (ORCPT + 99 others); Mon, 23 Jan 2023 15:59:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232745AbjAWU6u (ORCPT ); Mon, 23 Jan 2023 15:58:50 -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 E02413802D for ; Mon, 23 Jan 2023 12:58:29 -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 1pK3pT-0000Lk-W6; Mon, 23 Jan 2023 21:54:12 +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 21/23] staging: r8188eu: struct agg_pkt_info is unused Date: Mon, 23 Jan 2023 21:53:40 +0100 Message-Id: <20230123205342.229589-22-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?1755851171881049244?= X-GMAIL-MSGID: =?utf-8?q?1755851171881049244?= struct agg_pkt_info is not used in the r8188eu driver. Remove it. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/include/rtw_xmit.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index 4aa7833487c8..548d2cfb88ec 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -250,11 +250,6 @@ struct hw_txqueue { int ac_tag; }; -struct agg_pkt_info { - u16 offset; - u16 pkt_len; -}; - struct xmit_priv { spinlock_t lock; struct list_head be_pending; From patchwork Mon Jan 23 20:53:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47398 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811872wrn; Mon, 23 Jan 2023 12:58:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXsWkil3e36uUaVUnKAWMPZY9RlDjSnkIgN0+x9ZwGhiV6W04/QxmVXo3Q6fpBR0iuX2pT+w X-Received: by 2002:a17:902:f28a:b0:194:8c76:42dd with SMTP id k10-20020a170902f28a00b001948c7642ddmr22584746plc.19.1674507535593; Mon, 23 Jan 2023 12:58:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507535; cv=none; d=google.com; s=arc-20160816; b=FdmSOBcyTLFRsfGgTAtQGzizWXS/roivjsUDZAMKbRfGYYzdalVPnKtyNOHBCyH0KY efRbe+NW3ZO0zt7qko5SS/seRMKJwe/mwM7x0LRzt4OW6b3Jvsic+EMyUbviQ8wGsw0q gpj9LC7otg4ZlIQN5qIVWUAycm47PmFuaB5Btzwg4akS0lZVv43zbdk/ha10GvUivZBq cJc8vWktYqpfyQg80eXx/6yXZb2W76DV2xQ23iF+XKCpRBO3ICnaFGSCiKyoHsOoLolE JfEOR7QQWsrXG+IhXYi+KgQqHZI1MAUWofc+qtR7ODYYcKwVcoGw+uT2wtjG7T8/1hXG m9Wg== 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=hrhlsSxiUAWOX8/CHFVJQnptMtV8ma5+evrG6vkefL0=; b=cQvTm5HzGx/8mwqu+QXzi4hfFkkaBK86N0JCh7SlZhEUL1c4gF5GKJygXossMhAiw1 dlhYYNjAWnFz+BC6KuGEOfAomfj46tnZCQjC0qUzuDnyeg6oyTxk8c9+O0TgiXDHmNUf RvLuE4GkRKFEvuhsQSLeszs/SvT6qanW7gJ6fUgSuAGLn4njzkjatBJbE5buBYY8Bg2T gxmqZxrDDD/fdOB6gb3Oe/MKSK98hYqxD2FBRz0s1eQrL4TCy4Hei53o95M1L4Fz9Djf IeNxUu/DikDpliSEw9GiOUFBeMl8Jr3bxI6ygkIdg6qyWtVdJUzDm0ynGlVUcmr1Eezw /WZA== 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 e11-20020a17090301cb00b001867ea919bdsi484553plh.25.2023.01.23.12.58.43; Mon, 23 Jan 2023 12:58:55 -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 S232360AbjAWU62 (ORCPT + 99 others); Mon, 23 Jan 2023 15:58:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232315AbjAWU6Y (ORCPT ); Mon, 23 Jan 2023 15:58:24 -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 8FBB33864D for ; Mon, 23 Jan 2023 12:58:02 -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 1pK3pU-0000Lk-OM; Mon, 23 Jan 2023 21:54:12 +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 22/23] staging: r8188eu: apsd_setting is unused Date: Mon, 23 Jan 2023 21:53:41 +0100 Message-Id: <20230123205342.229589-23-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?1755848413757146399?= X-GMAIL-MSGID: =?utf-8?q?1755848413757146399?= apsd_setting in struct tx_servq is not used, it can be removed. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/include/rtw_xmit.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index 548d2cfb88ec..33c3031de2c4 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -228,8 +228,6 @@ struct tx_servq { struct sta_xmit_priv { spinlock_t lock; int option; - int apsd_setting; /* When bit mask is on, the associated edca - * queue supports APSD. */ struct tx_servq be_q; /* priority == 0,3 */ struct tx_servq bk_q; /* priority == 1,2 */ struct tx_servq vi_q; /* priority == 4,5 */ From patchwork Mon Jan 23 20:53:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 47396 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1811798wrn; Mon, 23 Jan 2023 12:58:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXvyB95bl8ODk/DJc/D5dlJHLBDWXrch1P4DXu8Y2CzO1Z93HGoLHDjkFxwEB/6OtkpJ7Pab X-Received: by 2002:aa7:8819:0:b0:58d:a040:e6a9 with SMTP id c25-20020aa78819000000b0058da040e6a9mr27964658pfo.28.1674507523223; Mon, 23 Jan 2023 12:58:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674507523; cv=none; d=google.com; s=arc-20160816; b=dbLAe0hp6kh96oL5PTYLzRLHe+u8HTiP0IUbHbHi4R2SpqMAZlNlXohO2WjA9gCU8/ /EDM2KpQl2MooOnIAseeLpX7tFJLG7wZu58ZQ0zZfU2koDuiG+Uj6FIqIAVu/f8g/b99 cLf66xc7xrN1PyU2CrhxlcMb9Va2FkEauuewnCH9CjL6H15/TOoInq7R8ip7XMjCr0Av XgMn1aKi3BunTLTUWyzTYVae5ViSg+9jH8lzcD2sP9ivh48jcdYKL1SgQ4gHu7FruY6l EBCGbzmcy/B7vsjMoDtVjFykm17dfTyWsjpueuj+qUNxI1bcRhYKJGJ2Ax0hvfBnZYnl M4wg== 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=oN7ADI2/od/saEOXvHLHg7KLHSKXSoOqvy8at8GlQzQ=; b=YK539G3FZS2rqIMZo9UIEjsrLNAXnpQAXx7OQCCbmGWn97FV+R9RDm3WLOYfIDHwk4 D8lNPREJS2wHC1uVfqWkM1gTOoSOTk7VRHN216H06sOQ/yxRbzOPySXmEjPPxTjD5Unz yl1lPQPPXvOV72jRf7LSQiltjxyycnFMfQR39d/K7VITW9zV+QV4gncumZZiqSdMje7f VZwbN0cCrvTUTggPk0r6JDEvFJNnja2pdzfAMeeY0hD7rEB7onIuVOBIoEMA/Euxjlvd LhVGQ+XsYOf0sXlY3p6xbpSWPab5YKrbW/xSWPtchqLVvFAqSkfjc0BdbgRVign8bQF9 JEnw== 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 d201-20020a621dd2000000b005627f4b21absi52057pfd.296.2023.01.23.12.58.08; Mon, 23 Jan 2023 12:58: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 S232143AbjAWU5d (ORCPT + 99 others); Mon, 23 Jan 2023 15:57:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232127AbjAWU5a (ORCPT ); Mon, 23 Jan 2023 15:57:30 -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 D11333252B for ; Mon, 23 Jan 2023 12:57:18 -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 1pK3pV-0000Lk-Kt; Mon, 23 Jan 2023 21:54:13 +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 23/23] staging: r8188eu: merge rtw_free_hwxmits into its only caller Date: Mon, 23 Jan 2023 21:53:42 +0100 Message-Id: <20230123205342.229589-24-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?1755848400518564459?= X-GMAIL-MSGID: =?utf-8?q?1755848400518564459?= rtw_free_hwxmits is called only by _rtw_free_xmit_priv. We can merge the two functions and make the code a bit shorter. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 11 +---------- drivers/staging/r8188eu/include/rtw_xmit.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 3752d4fddd11..f50e10f0d51f 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -281,7 +281,7 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) vfree(pxmitpriv->pallocated_xmit_extbuf); - rtw_free_hwxmits(padapter); + kfree(pxmitpriv->hwxmits); mutex_destroy(&pxmitpriv->ack_tx_mutex); } @@ -1475,15 +1475,6 @@ int rtw_alloc_hwxmits(struct adapter *padapter) return 0; } -void rtw_free_hwxmits(struct adapter *padapter) -{ - struct hw_xmit *hwxmits; - struct xmit_priv *pxmitpriv = &padapter->xmitpriv; - - hwxmits = pxmitpriv->hwxmits; - kfree(hwxmits); -} - static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) { struct sk_buff *skb = *pskb; diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index 33c3031de2c4..d8808e68f778 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -328,7 +328,6 @@ s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter); void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv); int rtw_alloc_hwxmits(struct adapter *padapter); -void rtw_free_hwxmits(struct adapter *padapter); s32 rtw_xmit(struct adapter *padapter, struct sk_buff **pkt); int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct xmit_frame *pxmitframe);