From patchwork Fri Dec 30 18:06:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37729 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008317wrt; Fri, 30 Dec 2022 10:08:05 -0800 (PST) X-Google-Smtp-Source: AMrXdXsbTmFUnFAXgU+/CXF/APrJrExjgr4lII4GoxojGUK+gceeCmwnZye0EarPpF918pYfocno X-Received: by 2002:a17:90a:1089:b0:226:3305:b072 with SMTP id c9-20020a17090a108900b002263305b072mr6088913pja.29.1672423684688; Fri, 30 Dec 2022 10:08:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423684; cv=none; d=google.com; s=arc-20160816; b=tO7zrk3kDFuW6WyLNjJu3f6yiZaHUEz3KEmosI4Ax4ko8miYOhYxG5/T6a/pGYcwyh ngtJDQ53J2Um0vmIOE61yKkumfkwxyBFRYwbhnma4lE7T7Vj4TED1kT5NFJlm26rJx8/ xPX4Siur8iw4X9IrM+eYMR/1Iquhnqk9X2t6SRReMZFYeSOikgoQPbhQ2oVjWA8f5NdC xeuR4SlbmgfrL/zb1pJIqxbz6Gsajn7nAuRgmn0UbpRebUs5zypAlax/HC5ziSeQ5pZh 57aFML8j6Wso+42HrtxdKiZcS1xqtNmJmKNRz0Mzn728jVjjGs/MaMG2rnpqm46hs4cH cM7A== 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=owvYwEn7S/5FDQeiC0iDlg4bP/bANVVwDFI945nRit0=; b=Ls6LB1ZbCbIMS53NMQ26MAItV897hQ5oZmdmRIzO+99ZO51aEV22iKqZjF1RgNNieb 9B6+JXW5bOUrtBu5p+A30DTqHPhtePiYU8p2nkk68UHU0D3vv+Av+jHVp02KiE/SHe0S 3xFeQTfLp505Gf0gvNUjIYe/fOMv8VqyGWZkj0DJYb/0YDVzar+b12JlNA9qCiVZ5S4d 4dvTFjggOMXlfvFWcvgKQze6KYFpXjCHABZqVcSciYvEaZ9qUjPAGS7csFLkIKPLhIkb BZkqDz2kn5PjX/0zkafDydmkW+E7Rff4dwdABJLxXlIBk8lRDIUHD3fKVS2Q9nxJwG3C EY3w== 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 v15-20020a17090a898f00b00223facc5d2csi21509492pjn.162.2022.12.30.10.07.52; Fri, 30 Dec 2022 10:08:04 -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 S235430AbiL3SHQ (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235405AbiL3SHN (ORCPT ); Fri, 30 Dec 2022 13:07: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 31C426248 for ; Fri, 30 Dec 2022 10:07:12 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmc-0004rR-KE; Fri, 30 Dec 2022 19:07: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 01/20] staging: r8188eu: make xmitframe_swencrypt a void function Date: Fri, 30 Dec 2022 19:06:27 +0100 Message-Id: <20221230180646.91008-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663337545231178?= X-GMAIL-MSGID: =?utf-8?q?1753663337545231178?= xmitframe_swencrypt always returns _SUCCESS and the caller does not check the return value. We can remove the return value and make xmitframe_swencrypt a void function. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 34494f08c0cd..4cd457cfb791 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -761,7 +761,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr return _SUCCESS; } -static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmitframe) +static void xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmitframe) { struct pkt_attrib *pattrib = &pxmitframe->attrib; @@ -781,8 +781,6 @@ static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmi break; } } - - return _SUCCESS; } s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattrib) From patchwork Fri Dec 30 18:06:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37730 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008334wrt; Fri, 30 Dec 2022 10:08:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXutsg12r1tw1zO+QOs55wIncExSbaiFAmR/p4TTKmFmgEjBWr32i9yc4vBeEVmnJGfcNgVe X-Received: by 2002:a17:90a:460a:b0:223:ed96:e3ca with SMTP id w10-20020a17090a460a00b00223ed96e3camr35490956pjg.28.1672423686275; Fri, 30 Dec 2022 10:08:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423686; cv=none; d=google.com; s=arc-20160816; b=RpkL8a2dPKIfyboNiMEER/CoLh4FyD/zA3RooPIS7Vhjk32bU2SI/zO2LkXQG/Gec3 yzxbvTkG0vDIn0KOU0+zYroEaoHK9ytpw59OLGHf+Fkple4id5eA647nCT6o/7zgc+By z5wGtEAW3vNqNhaCI15aBLtfJUBz1jIQjsFzAValkDYLweQ5Bci1TkmSIXOZQZUiDM5K ZRmKbU/lO6LnoqcxEyg0wgLpnpir6H/PMbyziScSnmxAVEhPGLVszxy+XsBdaMikt3xb MyR8eGrepTFuwbLyrFo3BIbHsa8UvlkCkl0oxc/JDeJ2eNZFGnq/GlCiZDTP00Dr7wE5 Nisw== 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=9jHKqYo8DMs8x6kzB9kTXWlk30gU1sluXmaaWNHvsNQ=; b=if+3o+h0an3/NVt3saXHJHb6BcBikticXKKVewjk0HckHNP4/ZrC0paeSwcPGpCzih hfxNUlQTzfARS25hq9YlO74R6EWa+zHo4Q0Je+YQZfe1Ya8ytUdL/qfk5BeIXham+QDg 62ZkQg56mZOVKrTi51g6axi+tIJFubZfoRZdZLWBq0OrqNHaU15uTVtIiGjE4fZ8WaHK 3fuCW/cAIfSqmzrrY2KBtoyF4iJDL9FKgbMNx9xrJqjqHrP7YumE3zD1u/04jfU+wicN qVuaTepH/L0QWo70EKIhEQ4yxoqq17ujiqk1yRIr1UkHDj/zOj6y9QFNfaQchuWC3dbb kaZA== 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 26-20020a63185a000000b00477cd382329si22714524pgy.56.2022.12.30.10.07.54; Fri, 30 Dec 2022 10:08:06 -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 S235450AbiL3SHV (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235412AbiL3SHO (ORCPT ); Fri, 30 Dec 2022 13:07: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 6361B60E2 for ; Fri, 30 Dec 2022 10:07:13 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmd-0004rR-It; Fri, 30 Dec 2022 19:07: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 02/20] staging: r8188eu: remove some unused CAM defines Date: Fri, 30 Dec 2022 19:06:28 +0100 Message-Id: <20221230180646.91008-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663339517635007?= X-GMAIL-MSGID: =?utf-8?q?1753663339517635007?= Remove some CAM-related defines which are not used in the r8188eu driver. Signed-off-by: Martin Kaiser --- .../staging/r8188eu/include/rtl8188e_spec.h | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/drivers/staging/r8188eu/include/rtl8188e_spec.h b/drivers/staging/r8188eu/include/rtl8188e_spec.h index 3fa3b3e5dd64..25b31417cd58 100644 --- a/drivers/staging/r8188eu/include/rtl8188e_spec.h +++ b/drivers/staging/r8188eu/include/rtl8188e_spec.h @@ -510,28 +510,7 @@ Default: 00b. /* 8192C BW_OPMODE bits (Offset 0x203, 8bit) */ #define BW_OPMODE_20MHZ BIT(2) -/* 8192C CAM Config Setting (offset 0x250, 1 byte) */ -#define CAM_VALID BIT(15) -#define CAM_NOTVALID 0x0000 -#define CAM_USEDK BIT(5) - -#define CAM_CONTENT_COUNT 8 - -#define CAM_NONE 0x0 -#define CAM_WEP40 0x01 -#define CAM_TKIP 0x02 -#define CAM_AES 0x04 -#define CAM_WEP104 0x05 -#define CAM_SMS4 0x6 - -#define TOTAL_CAM_ENTRY 32 -#define HALF_CAM_ENTRY 16 - -#define CAM_CONFIG_USEDK true -#define CAM_CONFIG_NO_USEDK false - #define CAM_WRITE BIT(16) -#define CAM_READ 0x00000000 #define CAM_POLLINIG BIT(31) #define SCR_UseDK 0x01 From patchwork Fri Dec 30 18:06:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37731 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008356wrt; Fri, 30 Dec 2022 10:08:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXucsLOg1MIe2MrIEOzaQiNVrdIJSQJj8bcJ2XO+jX7C3qtwueY0W+Vqs2P8hVZdTNLebXW6 X-Received: by 2002:a17:902:c404:b0:192:5eee:323a with SMTP id k4-20020a170902c40400b001925eee323amr43761606plk.28.1672423688775; Fri, 30 Dec 2022 10:08:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423688; cv=none; d=google.com; s=arc-20160816; b=QZmcWXbboXz98NUQythn67/Sl43LIcp1LQl+z32iW5iYIcPAlapqJPwb1Ja3xeeKy1 1kibmkRYxeSemY3PzNslT/tl174WSGSc+H6lZNWbhFWPIiSvAhEU31DDWasM2IYiAMlm Pyrt4FGz1cjABzK56uV1nvKffxW6vqjMTzIlHKNx7qkh84sh941QNZuRiHrfhmn2DNqq 7OQnE1Ci6D6HA7Tf7d7K9EFCRSaiY+Roy/zCoZ0L3xUeq73vn6xUcMM/hNEMbnxYj1Zc 34YoH5JMpHHqbmeIU4ECq3NNO/C3Mk5r9lJKSzqhau9RS78aAm6FpulwRgpCuH/Ba29G DLEA== 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=3coU5E3acTy4oiBZxp2FHq/1o6tYDUFQ6gDSxEMc4/M=; b=hJnH3pctuQ53El/KSs6R6eHoqo2rLJTGRhqXIuTPub72fSoWiZI9sEi3nP64ikD43J SJ8FDzWE8WMOWQxQKwa8TASSo4W7IG+CXW0K0LoGO0GfYYW+vrznRP5pjgY8q+q0G47/ /qVCDpH61cuQrkDqwxNL05e+OvLfIVhmJHb6kEPO54jl3ZcyK6M1UyOBcwS5M11NRaa1 Q+eMpdT3JKVKytNAkGHQ3vfd6wP8NVf0ZgIeXBFEEm1rvK9QmccsjBsysfompR3Yhwbc F2CvZtZMgl8H3DwixWky/3knvHYdM2roU+TngDuOX2INFQx4giBRIi7rnu+XZmca91dw DdFw== 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 c18-20020a170902d49200b00186f81a0765si23466039plg.540.2022.12.30.10.07.56; Fri, 30 Dec 2022 10:08: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 S235461AbiL3SHY (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235415AbiL3SHO (ORCPT ); Fri, 30 Dec 2022 13:07: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 B2BCE6248 for ; Fri, 30 Dec 2022 10:07:13 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJme-0004rR-DF; Fri, 30 Dec 2022 19:07: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 03/20] staging: r8188eu: cmd_seq is write-only Date: Fri, 30 Dec 2022 19:06:29 +0100 Message-Id: <20221230180646.91008-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663342219742078?= X-GMAIL-MSGID: =?utf-8?q?1753663342219742078?= The cmd_seq component of struct cmd_priv is set and incremented but never read. It can be removed. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_cmd.c | 4 ---- drivers/staging/r8188eu/include/rtw_cmd.h | 1 - 2 files changed, 5 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_cmd.c b/drivers/staging/r8188eu/core/rtw_cmd.c index 19b2f73d481d..eb79435da355 100644 --- a/drivers/staging/r8188eu/core/rtw_cmd.c +++ b/drivers/staging/r8188eu/core/rtw_cmd.c @@ -65,8 +65,6 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv) /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ - pcmdpriv->cmd_seq = 1; - pcmdpriv->cmd_allocated_buf = kzalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ, GFP_KERNEL); @@ -233,8 +231,6 @@ int rtw_cmd_thread(void *context) ret = cmd_hdl(pcmd->padapter, pcmdbuf); pcmd->res = ret; } - - pcmdpriv->cmd_seq++; } else { pcmd->res = H2C_PARAMETERS_ERROR; } diff --git a/drivers/staging/r8188eu/include/rtw_cmd.h b/drivers/staging/r8188eu/include/rtw_cmd.h index c330a4435b31..9df7d4bf441d 100644 --- a/drivers/staging/r8188eu/include/rtw_cmd.h +++ b/drivers/staging/r8188eu/include/rtw_cmd.h @@ -32,7 +32,6 @@ struct cmd_priv { struct completion start_cmd_thread; struct completion stop_cmd_thread; struct __queue cmd_queue; - u8 cmd_seq; u8 *cmd_buf; /* shall be non-paged, and 4 bytes aligned */ u8 *cmd_allocated_buf; u8 *rsp_buf; /* shall be non-paged, and 4 bytes aligned */ From patchwork Fri Dec 30 18:06:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37732 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008367wrt; Fri, 30 Dec 2022 10:08:11 -0800 (PST) X-Google-Smtp-Source: AMrXdXt21nJ1lQyZ2v8qyb8yymdSb4d0+Fs6cwaWrV0FBDywcolxMDhAELMUjtlahGKUBWBHx0EI X-Received: by 2002:a17:90a:b78b:b0:223:9b0d:15ab with SMTP id m11-20020a17090ab78b00b002239b0d15abmr38316703pjr.12.1672423691048; Fri, 30 Dec 2022 10:08:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423691; cv=none; d=google.com; s=arc-20160816; b=aFvR06uRd6ml+0ybKZw1xQ3LU6hvrvrw7YbkUs8GYY+L3APiTSrWoWtEHC2Eug4eJ1 v/au6cgnxzTGd6OLeENfGfJ7MLsc4ubglOnr0JAkdzCUPKngSnFYdtpqTpxvUykquWxv a3nqSbK0shY4wjKMOm6C06/wkgfD1sWakZNIhBOmC5ZgeydYf6MkwLKJ2+7mB560iyue WiQ+ypWwh3q2PPXlDVFziJvpmw1fDEZSlQEF4WwqzGBET8D/sCOkJnvM+S2MQ92SsyR5 HEFRC5h3U2r4E4DLe3f6sA8D2RB3cdLj04M0LaPoxDEZkCYxwkjByqvvKFrxIZNLat6Q u1MA== 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=h0FQPOUDjCyQNi3QfURkQUvZNbXTtDGRx5NYoaVxhf0=; b=zYdCyxFHAtUouqfi2VjurlSKNGPgrPaPrmgHl3X+ri36czr60DfTPL5Z5jfGl+05Dq pu1RUH87j9+BRV8lX66bidQwRbe9wGStwWHb53fOua5Pnfj7hbZYnLyIloIWK3Km8/o2 qx3RynJuBSD0IWdwyfQK1ntNUfFEnsZC+qD8l3m8RgPP2IydnxRvUDTOKQJKHT7goA4E ZQ1EUIkyoe+LU0av5J6UBEwIHCpBU7+s1pQtDb8C9CDKsW2iXM3V/DPtRXuNYLHlitPT 2AjtFQcWkTJ5Dl+iGWaZYtO6G4GMCJ088vS1qf/csrNx9vJU1QFGzxrmhB3dHqe0zVBm f61A== 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 q15-20020a63d60f000000b004774a855375si21757613pgg.351.2022.12.30.10.07.59; Fri, 30 Dec 2022 10:08:11 -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 S235471AbiL3SHa (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235422AbiL3SHQ (ORCPT ); Fri, 30 Dec 2022 13:07:16 -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 452796248 for ; Fri, 30 Dec 2022 10:07:15 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmf-0004rR-6C; Fri, 30 Dec 2022 19:07: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 04/20] staging: r8188eu: return immediately if we're not meant to encrypt Date: Fri, 30 Dec 2022 19:06:30 +0100 Message-Id: <20221230180646.91008-5-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663344213659274?= X-GMAIL-MSGID: =?utf-8?q?1753663344213659274?= In function xmitframe_swencrypt, we can return immediately if our packet needs no encryption. This is simpler than wrapping all the code into a large if statement. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 31 +++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 4cd457cfb791..35d291d78c60 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -765,21 +765,22 @@ static void xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxm { struct pkt_attrib *pattrib = &pxmitframe->attrib; - if (pattrib->bswenc) { - switch (pattrib->encrypt) { - case _WEP40_: - case _WEP104_: - rtw_wep_encrypt(padapter, pxmitframe); - break; - case _TKIP_: - rtw_tkip_encrypt(padapter, pxmitframe); - break; - case _AES_: - rtw_aes_encrypt(padapter, pxmitframe); - break; - default: - break; - } + if (!pattrib->bswenc) + return; + + switch (pattrib->encrypt) { + case _WEP40_: + case _WEP104_: + rtw_wep_encrypt(padapter, pxmitframe); + break; + case _TKIP_: + rtw_tkip_encrypt(padapter, pxmitframe); + break; + case _AES_: + rtw_aes_encrypt(padapter, pxmitframe); + break; + default: + break; } } From patchwork Fri Dec 30 18:06:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37738 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008526wrt; Fri, 30 Dec 2022 10:08:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXu5gztI2yeb7NfBcG1x3ybTeoTo8UR+qCwS6yKuG0dWj4aa8UT7reQhtmP4Y0P9KYD/wPEH X-Received: by 2002:a05:6a21:99a4:b0:a3:94cd:1435 with SMTP id ve36-20020a056a2199a400b000a394cd1435mr53437630pzb.38.1672423714378; Fri, 30 Dec 2022 10:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423714; cv=none; d=google.com; s=arc-20160816; b=pCn5tHuL6hSO4/SoukU/Lu9t6/mK6dPG1AgZhk+EbDEPF8DegmlBZe0gthLrZjM0Ov blKjudJGtK8bkiJhnFq7GgnkpYvxJAu+NAVZkLKlghdOWrA4LGOtlK0JB37xlNHkt7gY L0Lh3S5EdRWFVqzQhUyPOFT6cjq1jsoM5sm0cnPn7XD1uBQZHKcv7FMyVlKXAk5IfLbI 7oovtomBDNx4JOrbw2170lcV1N1/dKPbSqw4bh810dmdc90Glb2qK7goCmBQt77pzt65 zkyneza1+6S6MQGBg93WZm4niilTVl9+nod+L4aa757TqLozuPSKNIRngq1giJC+2Zri lJtA== 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=YJkQyA5IeCM97a2hsDIdQ5WdaSjLghZDQusuBL/CRuQ=; b=eJw+hte6Zdog0uYHMHDJJkMMMGNnECLB4arAI4BgTXVXvS5NYs3HOoU9Ea/z/1YISj fFhSP212lQ6gXa3j6nHv2o+oc5vvOwiIHw5Rel9ZhS1T893k1CkmpioMltvS3sOts42d 6DyQNka4iXChT+GQP4EsmzbxOjUpWUvtUxndI9WLtYZFtj4rO9gcVUmGd6AzRJrSQ+UQ 9ngBvJJIneEgeawNHHx4ChBZ9t8lrdjK1RRkMmYFpcqXgKlBgmkMD0SUrROBGTwYxQD/ BTxl3EmMFGfFsgjN+v1WgZYpjnaVZTE/0YVIdL8JEaqLWR4/+HOLyOl0CuHZvmPI9WS4 ndkA== 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 e21-20020a637455000000b0046f3dfb97a5si23495739pgn.660.2022.12.30.10.08.21; Fri, 30 Dec 2022 10:08:34 -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 S235465AbiL3SH1 (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235421AbiL3SHP (ORCPT ); Fri, 30 Dec 2022 13:07: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 B505C60E2 for ; Fri, 30 Dec 2022 10:07:14 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmf-0004rR-Ve; Fri, 30 Dec 2022 19:07: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 05/20] staging: r8188eu: remove unused parameter Date: Fri, 30 Dec 2022 19:06:31 +0100 Message-Id: <20221230180646.91008-6-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663368935448519?= X-GMAIL-MSGID: =?utf-8?q?1753663368935448519?= All callers of rtl8188eu_xmitframe_complete set the pxmitbuf parameter to NULL, in which case rtl8188eu_xmitframe_complete allocates another xmit_buf internally. Remove the pxmitbuf parameter and resulting dead code. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 12 +++++------- drivers/staging/r8188eu/hal/usb_ops_linux.c | 2 +- drivers/staging/r8188eu/include/rtl8188e_xmit.h | 3 +-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c index 6d1f56d1f9d7..cca74cf28915 100644 --- a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +++ b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c @@ -375,11 +375,12 @@ static u32 xmitframe_need_length(struct xmit_frame *pxmitframe) return len; } -bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf) +bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitpriv) { struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapt); struct xmit_frame *pxmitframe = NULL; struct xmit_frame *pfirstframe = NULL; + struct xmit_buf *pxmitbuf; /* aggregate variable */ struct hw_xmit *phwxmit; @@ -403,12 +404,9 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmit else bulksize = USB_FULL_SPEED_BULK_SIZE; - /* check xmitbuffer is ok */ - if (!pxmitbuf) { - pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv); - if (!pxmitbuf) - return false; - } + pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv); + if (!pxmitbuf) + return false; /* 3 1. pick up first frame */ rtw_free_xmitframe(pxmitpriv, pxmitframe); diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c index 7c72f5e04d9b..c51f860d3527 100644 --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c @@ -494,7 +494,7 @@ void rtl8188eu_xmit_tasklet(unsigned long priv) (adapt->bWritePortCancel)) break; - ret = rtl8188eu_xmitframe_complete(adapt, pxmitpriv, NULL); + ret = rtl8188eu_xmitframe_complete(adapt, pxmitpriv); if (!ret) break; diff --git a/drivers/staging/r8188eu/include/rtl8188e_xmit.h b/drivers/staging/r8188eu/include/rtl8188e_xmit.h index 6db7fabebea9..865468d6b922 100644 --- a/drivers/staging/r8188eu/include/rtl8188e_xmit.h +++ b/drivers/staging/r8188eu/include/rtl8188e_xmit.h @@ -138,7 +138,6 @@ s32 rtl8188eu_xmit_buf_handler(struct adapter *padapter); #define hal_xmit_handler rtl8188eu_xmit_buf_handler void rtl8188eu_xmit_tasklet(unsigned long priv); bool rtl8188eu_xmitframe_complete(struct adapter *padapter, - struct xmit_priv *pxmitpriv, - struct xmit_buf *pxmitbuf); + struct xmit_priv *pxmitpriv); #endif /* __RTL8188E_XMIT_H__ */ From patchwork Fri Dec 30 18:06:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37734 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008392wrt; Fri, 30 Dec 2022 10:08:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXsoZ7O8w2lEaczI7QnqrirBD1VeGpTqhF7PBn5kmu8DsGu54Y3oVH31c8i7/KronMZCWeti X-Received: by 2002:a17:90a:9304:b0:223:fcc8:d7dd with SMTP id p4-20020a17090a930400b00223fcc8d7ddmr35747317pjo.30.1672423695974; Fri, 30 Dec 2022 10:08:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423695; cv=none; d=google.com; s=arc-20160816; b=FIEB8ZokLuWDwWSGhiZmpUS7K+rSbiji1lAvWFJIaFLAbnm9DlHUS/T1VYZlLA6C/2 hVvVYHWvCgeAn57LjLIDN87dNeb9rKwzryKDpT2kAh0CNJlM7Nq0VnV734TGqJu3kyk5 tYscVwkSQqA0x1uTv0fx/Whpr8T7AO6PHkscEsMeo2TGjVAv4HmGmbkZ8rGEYCaPflb2 jTV12CIB06vMQDTloJkAEXzBCd93qaUUJk/bJQYB6zpzgbpjw+xfyA4+3qec3UOfOEz/ ew/79QxRkV8UnqPMy1rvTbEh14S6D9zzJ5fFtofakybr8ZIW4QTRkQnLE9UM/1EAC+bx 5oWg== 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=rLMTyswHMdazjWN3u0Tm9OUy6TD5valgeQaae4MY8bE=; b=ZNysHplHz4tMQHbVc9kPsCfbXw+ZuUrbiO+e3kRsc7fF0XkonmifY2TrocCo+oQZga p/XmfFr1Xax4spZS1Ok0dObib71+laIAFVtghKptAov1O4/K4A9+ZomCHPzANK+5eA0f e8GhNJRLjwqV1lDKpQiWtUH/tBR5PUERy+xIWQ849WZGbylteuHJi/NOTC3cHsHQjS4q LWxIm7Gj7BtUHuMEYbWWL0uZBzo7vMAAcl8vKd9TrCMW8xpWXZmSSQWn6B19yoQGQZQB z4oqO4e8ozha3cIMh2dMG5EhrzlUHzRTIZ5qRG0UEIOU622BJpPkQp24BB7+Kklkj1JZ Tsww== 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 rm1-20020a17090b3ec100b00218592c28casi27777564pjb.33.2022.12.30.10.08.04; Fri, 30 Dec 2022 10:08:15 -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 S235475AbiL3SHf (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235432AbiL3SHR (ORCPT ); Fri, 30 Dec 2022 13:07:17 -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 AFF1E13F05 for ; Fri, 30 Dec 2022 10:07:16 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmg-0004rR-Oj; Fri, 30 Dec 2022 19:07: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 06/20] staging: r8188eu: simplify rtl8188eu_xmit_tasklet Date: Fri, 30 Dec 2022 19:06:32 +0100 Message-Id: <20221230180646.91008-7-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663349509742579?= X-GMAIL-MSGID: =?utf-8?q?1753663349509742579?= Simplify the rtl8188eu_xmit_tasklet function. Remove an unnecessary temporary variable and reformat the code. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/usb_ops_linux.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/staging/r8188eu/hal/usb_ops_linux.c b/drivers/staging/r8188eu/hal/usb_ops_linux.c index c51f860d3527..a238d29a3a46 100644 --- a/drivers/staging/r8188eu/hal/usb_ops_linux.c +++ b/drivers/staging/r8188eu/hal/usb_ops_linux.c @@ -481,22 +481,14 @@ u32 rtw_read_port(struct adapter *adapter, u8 *rmem) void rtl8188eu_xmit_tasklet(unsigned long priv) { - int ret = false; struct adapter *adapt = (struct adapter *)priv; struct xmit_priv *pxmitpriv = &adapt->xmitpriv; if (check_fwstate(&adapt->mlmepriv, _FW_UNDER_SURVEY)) return; - while (1) { - if ((adapt->bDriverStopped) || - (adapt->bSurpriseRemoved) || - (adapt->bWritePortCancel)) - break; - - ret = rtl8188eu_xmitframe_complete(adapt, pxmitpriv); - - if (!ret) + do { + if (adapt->bDriverStopped || adapt->bSurpriseRemoved || adapt->bWritePortCancel) break; - } + } while (rtl8188eu_xmitframe_complete(adapt, pxmitpriv)); } From patchwork Fri Dec 30 18:06:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37733 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008379wrt; Fri, 30 Dec 2022 10:08:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXseeiAE6AORW8jeXry3N7UzRyhTP/LydE8fUcbhagjUDWWqRKO4iY4107J7FZIap47aljQS X-Received: by 2002:a17:902:ea02:b0:191:271f:477c with SMTP id s2-20020a170902ea0200b00191271f477cmr36366344plg.32.1672423693163; Fri, 30 Dec 2022 10:08:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423693; cv=none; d=google.com; s=arc-20160816; b=ibPsbYjUmb4VFNQGNgdMpTyMiRzHgE+vCELbRsRTreVjecV2+wewV2ZLXNL7tpwo5C vvRbmL2R/Zq0cRsdIRu7rQaKp6jDJeC9Yz+YzkERcWNJUlSe1SIO6Wm6LVMfxytTdqFB 9zATQGBoxf3AhntSuj9VjTnfuTHexFmbTty2gfWjBTacMgtTXEpns305fWej6/fMneTr zhkrxpltWkMQJJhmadERdADQLkyamHH/94WpIKs0q/xIlLwqfuMASHl9Ev9vmy1JVIO1 5qV4GW4WsYNzkmasmIA5sEPrvsO/nn5R6pNHljWPqKwlNQLly9uooDJVqT7+ejk+nORY v6+w== 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=2R7kegvqFcvrMC6siRVf7ShUBth0cs5a6HZ1GbRh4NE=; b=wNHJigF4acipQCraPyEixYiI23dM+n7b2mTD0BHi0g/+Eju9aLwGXUUdH0pxDexYME KYbSiJtj1YuUOOQo6AELkI8hCilN9V9JEME1SD6Z+PZEwSvrjbUIWda3KYoAbAhHJag9 El+uEqfUIaWASDCT2Uvv1+Jakkine2mACNwsgaIGvYx7iTFW4SBKyjw9czNxukV85hDl yk/2ihQgwuKztBK/jGRQ021h9OnVTWiMDuAoBe0367iJQ+pMbj0Hy4zk3quNLpXSFWMn 8v9OrvQ3J5ZyF5D39GdcEInt6yvJ2nrvXJ7cPs5KEGCqyI92leC7lssv/UvPjDKh/n3U h5yQ== 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 i9-20020a17090332c900b00186b1459953si23807161plr.382.2022.12.30.10.08.01; Fri, 30 Dec 2022 10:08:13 -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 S235266AbiL3SHc (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235435AbiL3SHU (ORCPT ); Fri, 30 Dec 2022 13:07: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 4D6FB1C429 for ; Fri, 30 Dec 2022 10:07:17 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmh-0004rR-H7; Fri, 30 Dec 2022 19:07:11 +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/20] staging: r8188eu: remove rtl8188eu_init_xmit_priv Date: Fri, 30 Dec 2022 19:06:33 +0100 Message-Id: <20221230180646.91008-8-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663346103097197?= X-GMAIL-MSGID: =?utf-8?q?1753663346103097197?= rtl8188eu_init_xmit_priv's only jobs is to initialise the xmit tasklet. Remove rtl8188eu_init_xmit_priv and initialise the xmit tasklet in _rtw_init_xmit_priv. Yet again, this makes the code a tiny bit smaller. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 2 +- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 10 ---------- drivers/staging/r8188eu/include/rtl8188e_xmit.h | 1 - 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 35d291d78c60..62b66a205a06 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -211,7 +211,7 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) mutex_init(&pxmitpriv->ack_tx_mutex); rtw_sctx_init(&pxmitpriv->ack_tx_ops, 0); - rtl8188eu_init_xmit_priv(padapter); + tasklet_init(&pxmitpriv->xmit_tasklet, rtl8188eu_xmit_tasklet, (unsigned long)padapter); return 0; diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c index cca74cf28915..cf9779b86b9c 100644 --- a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +++ b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c @@ -9,16 +9,6 @@ #include "../include/usb_ops.h" #include "../include/rtl8188e_hal.h" -s32 rtl8188eu_init_xmit_priv(struct adapter *adapt) -{ - struct xmit_priv *pxmitpriv = &adapt->xmitpriv; - - tasklet_init(&pxmitpriv->xmit_tasklet, - rtl8188eu_xmit_tasklet, - (unsigned long)adapt); - return _SUCCESS; -} - static void rtl8188eu_cal_txdesc_chksum(struct tx_desc *ptxdesc) { u16 *usptr = (u16 *)ptxdesc; diff --git a/drivers/staging/r8188eu/include/rtl8188e_xmit.h b/drivers/staging/r8188eu/include/rtl8188e_xmit.h index 865468d6b922..82439f52b0c8 100644 --- a/drivers/staging/r8188eu/include/rtl8188e_xmit.h +++ b/drivers/staging/r8188eu/include/rtl8188e_xmit.h @@ -131,7 +131,6 @@ struct txrpt_ccx_88e { void rtl8188e_fill_fake_txdesc(struct adapter *padapter, u8 *pDesc, u32 BufferLen, u8 IsPsPoll, u8 IsBTQosNull); -s32 rtl8188eu_init_xmit_priv(struct adapter *padapter); 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); From patchwork Fri Dec 30 18:06:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37735 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008431wrt; Fri, 30 Dec 2022 10:08:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXtt1U4FZUSSzRSr2oL4tu5veaCvo4LFo6QZgaY5jOFgE78iDzwkTl/1Co+TSM4uQWVH9crW X-Received: by 2002:a05:6a20:4985:b0:ac:a2bb:96e6 with SMTP id fs5-20020a056a20498500b000aca2bb96e6mr34176118pzb.56.1672423701991; Fri, 30 Dec 2022 10:08:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423701; cv=none; d=google.com; s=arc-20160816; b=w2EWIe84MoJ+B1ORJzHn4h3DVMOLtCSNOF/yQ16+0vUMcDCgNHjdFYyvm595E1v8Mj fdZ018gJtGnJqD0VbgaYCjRqHJN9WcJtZE7S7FoKcj0OheoVDny12lXtSaiSa5mYrnoI +N1/9QOBsG4lF5sGQBPR7gvUXQID42X2efVYp/H/QoU5uG+1b1W262hpaPW4/pBoS/iI u3u4LsV/AdFIhbcFhU9EY9cTI6t2a/K4kaJWG6iKY3dsTMpIxMXvQ4S5YHDzpBHKQ8LH BW4RLIbaflDW8kSPS1847T/V6lCn1RGWiYaCaUi1XiLNuQekDXID0NIpRxUkmQbX5kIX ZjPA== 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=9riakcnRMBIWTC6w3yfgBcitUX8iJe1gQ0Q4SMsO3xA=; b=qiVrznnk5rqS4lUO8X7ssacDRRSHix/wMwxCWWDZyJOInKKoIwRtakwp+XMUmDWYRy 03o5AOQxvXknV3fAfZ4xSogeYOvynHqOP46t413cfhdzuAuT9KkD4SN+G1GUHMiX/qxY ygzScQVV5kGwPfCo2uTxesvTf9JvkA+RWVuRrHEesMrxmNvOLfVi1FYTVK8qRKgH/Ntw 7BiLnYdbyH4SFGcjMpXTzukWe8+f+FLO8zsGQy0qdKBrTA2aLMXXmkXRhe8Kz77/mqn1 DlYSpgZHKq+EgBDZQW7E1lHWF/K+yKf8Mu/ryLMuJn/pCwxomIFub+Hms1lgAFAUVvmb RhkQ== 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 11-20020a63050b000000b00477aeffa74fsi13482855pgf.107.2022.12.30.10.08.10; Fri, 30 Dec 2022 10:08: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 S235491AbiL3SHj (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235436AbiL3SHU (ORCPT ); Fri, 30 Dec 2022 13:07: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 C3BDC1C424 for ; Fri, 30 Dec 2022 10:07:16 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmi-0004rR-BI; Fri, 30 Dec 2022 19:07: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 08/20] staging: r8188eu: remove duplicate psta check Date: Fri, 30 Dec 2022 19:06:34 +0100 Message-Id: <20221230180646.91008-9-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663355657769569?= X-GMAIL-MSGID: =?utf-8?q?1753663355657769569?= We do not need the psta check in the while loop of rtw_xmitframe_coalesce. psta is already checked near the start of the function and is not modified afterwards. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 36 ++++++++++++------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 62b66a205a06..2bccb9ca42e9 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1009,25 +1009,23 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct /* adding icv, if necessary... */ if (pattrib->iv_len) { - if (psta) { - switch (pattrib->encrypt) { - case _WEP40_: - case _WEP104_: - WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - break; - case _TKIP_: - if (bmcst) - TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - else - TKIP_IV(pattrib->iv, psta->dot11txpn, 0); - break; - case _AES_: - if (bmcst) - AES_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); - else - AES_IV(pattrib->iv, psta->dot11txpn, 0); - break; - } + switch (pattrib->encrypt) { + case _WEP40_: + case _WEP104_: + WEP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); + break; + case _TKIP_: + if (bmcst) + TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); + else + TKIP_IV(pattrib->iv, psta->dot11txpn, 0); + break; + case _AES_: + if (bmcst) + AES_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx); + else + AES_IV(pattrib->iv, psta->dot11txpn, 0); + break; } memcpy(pframe, pattrib->iv, pattrib->iv_len); From patchwork Fri Dec 30 18:06:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37736 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008474wrt; Fri, 30 Dec 2022 10:08:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXvY/0jVKPZ9XYakKBa+ogT0BToe1rUm7zMVwP8fD85RzXzOsseHATYwadzRTx3L+5VIqp3T X-Received: by 2002:a17:90a:f614:b0:219:672a:42db with SMTP id bw20-20020a17090af61400b00219672a42dbmr40971128pjb.19.1672423706609; Fri, 30 Dec 2022 10:08:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423706; cv=none; d=google.com; s=arc-20160816; b=nRep3Oql3vPFO46gQbJFM4LqxfoDaMZFSix+pO5wgLK2WrIYYQTtbiW+meb0ShNQQ1 nDZHrFM8SzrfmHRlDhTcF2P3u87GxTHLqG0PZMkTLfl0UZ1GYh30HnZ+3j1QWXd1v8RR ahsEAShEI+E5NQ2syT4ZiWf6HFQyk8tkPqUDhqdDHSLmCZSb4eTDDwN1Qj3ZEqwyDfID zh5Jr4Uceqt5k3t9thzX3/CrBvdp5zM65wqPweWlfs5DGotWcX5z1f2VKG/snu6fu30e D0Glhxo0bN5axY4WkxB+PAEOlu19EE9IHbYGlQWFfZ1HCVIOAx/VKk3UBWVYKVlvXEU4 D1mQ== 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=5BadzVsgoO/PFohDV9+kmnVIe5Rv18qTamlfEvg46DY=; b=gfXyb0cSMXQyKZQxIXJUQmqFOth2wVkuNfrthjPPkCMA2y7WiVEM9uePb1TEmWGlXk S2/fPzaNF6kkGrCj8iStAQcdsMrhigmwM4f6GDk3rL089NdWnwYHE+CdBMBPY8GhMHq8 fAvl9I+sQ3tN7tXRjU/jbGAIxmDK4yU2Ie4hOe6X6s4nlnKq/gCg9ZIew2Yt/pWfqe8S E3oYuq3v3Hxwlrq8h6bTV+7sYJxgUN/LpuimXIvN0k7JSiwuGkIBOeqClNXdzDwPH9V0 4l9CyP6zB/ovl/rKWDbS4Yb8UD5I/s2v4ytTYmkr9NUon5uP4mfoltXjI4THbZsfrdtx NwWg== 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 h22-20020a17090adb9600b001f06a6fdb2fsi24729152pjv.27.2022.12.30.10.08.14; Fri, 30 Dec 2022 10:08: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 S235503AbiL3SHm (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235438AbiL3SHU (ORCPT ); Fri, 30 Dec 2022 13:07: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 723801C42C for ; Fri, 30 Dec 2022 10:07:18 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmj-0004rR-4g; Fri, 30 Dec 2022 19:07: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 09/20] staging: r8188eu: simplify frame type check Date: Fri, 30 Dec 2022 19:06:35 +0100 Message-Id: <20221230180646.91008-10-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663360428713253?= X-GMAIL-MSGID: =?utf-8?q?1753663360428713253?= Reorder the code in rtw_make_wlanhdr to make the function simpler. There's a large if statement to check that we process only data frames. Revert the condition and exit for non-data frames. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 139 ++++++++++++------------ 1 file changed, 70 insertions(+), 69 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 2bccb9ca42e9..502f9a6f4250 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -809,90 +809,91 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr SetFrameSubType(fctrl, pattrib->subtype); - if (pattrib->subtype & IEEE80211_FTYPE_DATA) { - if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { - /* to_ds = 1, fr_ds = 0; */ - /* Data transfer to AP */ - SetToDs(fctrl); - memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN); - memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); - memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN); - - if (pqospriv->qos_option) - qos_option = true; - } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { - /* to_ds = 0, fr_ds = 1; */ - SetFrDs(fctrl); - memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); - memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv), ETH_ALEN); - memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN); - - if (psta->qos_option) - qos_option = true; - } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || - check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { - memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); - memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); - memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN); - - if (psta->qos_option) - qos_option = true; - } else { - res = _FAIL; - goto exit; - } + if (!(pattrib->subtype & IEEE80211_FTYPE_DATA)) + return _SUCCESS; + + if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) { + /* to_ds = 1, fr_ds = 0; */ + /* Data transfer to AP */ + SetToDs(fctrl); + memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN); + memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); + memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN); + + if (pqospriv->qos_option) + qos_option = true; + } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { + /* to_ds = 0, fr_ds = 1; */ + SetFrDs(fctrl); + memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); + memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv), ETH_ALEN); + memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN); - if (pattrib->mdata) - SetMData(fctrl); + if (psta->qos_option) + qos_option = true; + } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || + check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { + memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); + memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); + memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN); - if (pattrib->encrypt) - SetPrivacy(fctrl); + if (psta->qos_option) + qos_option = true; + } else { + res = _FAIL; + goto exit; + } - if (qos_option) { - qc = (unsigned short *)(hdr + pattrib->hdrlen - 2); + if (pattrib->mdata) + SetMData(fctrl); - if (pattrib->priority) - SetPriority(qc, pattrib->priority); + if (pattrib->encrypt) + SetPrivacy(fctrl); - SetEOSP(qc, pattrib->eosp); + if (qos_option) { + qc = (unsigned short *)(hdr + pattrib->hdrlen - 2); - SetAckpolicy(qc, pattrib->ack_policy); - } + if (pattrib->priority) + SetPriority(qc, pattrib->priority); - /* TODO: fill HT Control Field */ + SetEOSP(qc, pattrib->eosp); - /* Update Seq Num will be handled by f/w */ - if (psta) { - psta->sta_xmitpriv.txseq_tid[pattrib->priority]++; - psta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF; + SetAckpolicy(qc, pattrib->ack_policy); + } - pattrib->seqnum = psta->sta_xmitpriv.txseq_tid[pattrib->priority]; + /* TODO: fill HT Control Field */ - SetSeqNum(hdr, pattrib->seqnum); + /* Update Seq Num will be handled by f/w */ + if (psta) { + psta->sta_xmitpriv.txseq_tid[pattrib->priority]++; + psta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF; - /* check if enable ampdu */ - if (pattrib->ht_en && psta->htpriv.ampdu_enable) { - if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) - pattrib->ampdu_en = true; - } + pattrib->seqnum = psta->sta_xmitpriv.txseq_tid[pattrib->priority]; - /* re-check if enable ampdu by BA_starting_seqctrl */ - if (pattrib->ampdu_en) { - u16 tx_seq; + SetSeqNum(hdr, pattrib->seqnum); - tx_seq = psta->BA_starting_seqctrl[pattrib->priority & 0x0f]; + /* check if enable ampdu */ + if (pattrib->ht_en && psta->htpriv.ampdu_enable) { + if (psta->htpriv.agg_enable_bitmap & BIT(pattrib->priority)) + pattrib->ampdu_en = true; + } - /* check BA_starting_seqctrl */ - if (SN_LESS(pattrib->seqnum, tx_seq)) { - pattrib->ampdu_en = false;/* AGG BK */ - } else if (SN_EQUAL(pattrib->seqnum, tx_seq)) { - psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = (tx_seq + 1) & 0xfff; + /* re-check if enable ampdu by BA_starting_seqctrl */ + if (pattrib->ampdu_en) { + u16 tx_seq; - pattrib->ampdu_en = true;/* AGG EN */ - } else { - psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = (pattrib->seqnum + 1) & 0xfff; - pattrib->ampdu_en = true;/* AGG EN */ - } + tx_seq = psta->BA_starting_seqctrl[pattrib->priority & 0x0f]; + + /* check BA_starting_seqctrl */ + if (SN_LESS(pattrib->seqnum, tx_seq)) { + pattrib->ampdu_en = false;/* AGG BK */ + } else if (SN_EQUAL(pattrib->seqnum, tx_seq)) { + psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = (tx_seq + 1) & 0xfff; + + pattrib->ampdu_en = true;/* AGG EN */ + } else { + psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = (pattrib->seqnum + 1) & 0xfff; + pattrib->ampdu_en = true;/* AGG EN */ } } } From patchwork Fri Dec 30 18:06:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008511wrt; Fri, 30 Dec 2022 10:08:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXu3wG5M1yq8gHUlbq77SU0rBleCRcZGcNLX53UB7XBO3j/oDciAauwAYMDXcaNV38eNafTX X-Received: by 2002:aa7:948b:0:b0:581:bca1:b7a3 with SMTP id z11-20020aa7948b000000b00581bca1b7a3mr9484404pfk.8.1672423712616; Fri, 30 Dec 2022 10:08:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423712; cv=none; d=google.com; s=arc-20160816; b=hM/3dbjz94AXckpZ/Zl5CF6t9l+4e2vDG917CouLzLae2euc99gktZaedaUOS169gh uYr3b9qdVEdrLDO0l5rmN5XhJBW01BTmzBZh7fPqENtZYg6AJpDJtMqRjTwCAuU8gNLR DRbw3H0o4/9zzW1hF+kP7u7srxHLU2tnfuPEY1/5+ta9Vd3rkKZl6p4X95/vtfrfYGjg AKgckwyiiDr9x1RmxStzNKZSHzkdURU+1L9U/EDg58YSXLMvABzdHk7QXF7fo/NR+AW+ DlHPc8EatW4DdKhoHEJ+WpVJWdmUA/40u4Gca8nWOeclhnxJDhpKzQ74jQbeInGAdDrM jISw== 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=Guls0RsIeVi/vUP74clNMtQZHfZXI0cGi3yo7hPYiks=; b=VhJFTpo4WU2J4zHceyWwzd27mQTtRmqLJmam8yK2qmmHewDwhapPontAGn7hUSdiPf onsyuSSacjHYcclXS+xGcEK+0TiS0sv9mWWTVnZ6HqspfCTmIo9pQ9yUBjOJo+pf28Y0 EmFV8iScjWJZdyYqgyAvBY8p0AX9GucZ1IW0La7m2BEnWd5stQG1axsNr8e8jVrTNMCH h2iTAfHYyrF7iS3Sn4fjit+ZakXA8gbBopoTHYMGPGEw0uFvpLC2uWvu86WI/0eCkthZ Oh71e7y6N79MKSYYpNj6BG5zCOXj7k/oNCDRkFV1X0c/znmLV1Wi2DGB0UIFT41A4sHZ FKRA== 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 j26-20020aa7929a000000b0056341219532si20819076pfa.89.2022.12.30.10.08.19; Fri, 30 Dec 2022 10:08:32 -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 S235470AbiL3SHp (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235444AbiL3SHV (ORCPT ); Fri, 30 Dec 2022 13:07:21 -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 7C5391C42D for ; Fri, 30 Dec 2022 10:07:18 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmj-0004rR-VU; Fri, 30 Dec 2022 19:07:14 +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/20] staging: r8188eu: simplify rtw_make_wlanhdr's error handling Date: Fri, 30 Dec 2022 19:06:36 +0100 Message-Id: <20221230180646.91008-11-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663366670388717?= X-GMAIL-MSGID: =?utf-8?q?1753663366670388717?= Simplify the error handling in rtw_make_wlanhdr. Exit immediately instead of jumping to the end of the function. We don't have to do any clean-up. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 502f9a6f4250..6e3b5649b84c 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -792,8 +792,6 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct qos_priv *pqospriv = &pmlmepriv->qospriv; u8 qos_option = false; - - int res = _SUCCESS; __le16 *fctrl = &pwlanhdr->frame_control; struct sta_info *psta; @@ -840,8 +838,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr if (psta->qos_option) qos_option = true; } else { - res = _FAIL; - goto exit; + return _FAIL; } if (pattrib->mdata) @@ -897,9 +894,8 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr } } } -exit: - return res; + return _SUCCESS; } s32 rtw_txframes_pending(struct adapter *padapter) From patchwork Fri Dec 30 18:06:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37739 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008537wrt; Fri, 30 Dec 2022 10:08:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXtxrzUVF5qjPHgVt86zQfKPXFz/PCxLOdGoK7lUrZT1OgwIU1dWvoCkijMx2SfTu5bIt8za X-Received: by 2002:a05:6a21:2d09:b0:a4:aa40:2253 with SMTP id tw9-20020a056a212d0900b000a4aa402253mr39743022pzb.21.1672423716285; Fri, 30 Dec 2022 10:08:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423716; cv=none; d=google.com; s=arc-20160816; b=rKNL0v8FL7qg8i9E3qvf7U9Aa33IBYyG9bk7JhMaJJHN74EQ2bB5GcPLlzueDxBw6E J7610uZv36JHqq7aB9yYDVpG37nhB5FvoLtjiwASdQgrcEjCOW/eWV+81pgp90DPAMj2 Z/NgBULk91uVnv+4wvZ3amXJE/wW0q6+zV/cmxnPsfbq3VJf3K4ZbmFQEj8ZBIxAY5kV 56t9yOwA5d/EbIZLwfCYebt6CRIRWo+G77XT4EwCnVaG+a8deERYuMJ+1Q4zFHvI2psX SKQQGfNAa4IBYUjp0WIGmzfma8SXsPX0vM+QgOTSRhRf8njrfVQih/N+Br4LPCjpEtvV F1pw== 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=gQhMRzDz0mQDPTcmXOeWrfR0LXflPQ4hCNzPpqE7dc0=; b=e7osnYGpT+jyN1fVrNc19Ifc6+DiZNDpUsg1K+YdEV11+S/mi6TfsVRRvAixr+ascE F9wbS3K3aJfXDlTPbXSQqaxGJ4fSqKJWIWzWmYIJTzEuoaUmf6M6k2XZTtSLrMihJhGq vAUNEPA0RtHPbTTpZE/bUcJP+aE9yC+VLnRwHL30L7c4S8dnd0TgvN60CjEVDdL4uE+w 2V8YJf4m+IuvPiBdLNWvGzDdsyRg02Kz3Xtio5OEjCswePbgnFX86XeaURm0omEtEuGo KxWOq1m+1bz2SZCYCfRKYsFFsF6qnbGFlb2CQRPIpmK87cpp6DwWxBQBIAqmRv4+KYdA 4dsw== 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 e2-20020a637442000000b0049f3be3d20bsi3114195pgn.333.2022.12.30.10.08.23; Fri, 30 Dec 2022 10:08:36 -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 S235514AbiL3SHt (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235412AbiL3SHX (ORCPT ); Fri, 30 Dec 2022 13:07:23 -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 E453B1C435 for ; Fri, 30 Dec 2022 10:07:19 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmk-0004rR-Po; Fri, 30 Dec 2022 19:07:14 +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/20] staging: r8188eu: clean up qos_option setting Date: Fri, 30 Dec 2022 19:06:37 +0100 Message-Id: <20221230180646.91008-12-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663370319676439?= X-GMAIL-MSGID: =?utf-8?q?1753663370319676439?= The qos_option variable in function rtw_make_wlanhdr should be a boolean as it's set to true or false. We can directly set it to pqospriv->qos_option instead of using a default value and if statements. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 6e3b5649b84c..0fef508408a7 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -791,7 +791,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr struct ieee80211_hdr *pwlanhdr = (struct ieee80211_hdr *)hdr; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct qos_priv *pqospriv = &pmlmepriv->qospriv; - u8 qos_option = false; + bool qos_option; __le16 *fctrl = &pwlanhdr->frame_control; struct sta_info *psta; @@ -817,26 +817,20 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN); - - if (pqospriv->qos_option) - qos_option = true; + qos_option = pqospriv->qos_option; } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { /* to_ds = 0, fr_ds = 1; */ SetFrDs(fctrl); memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv), ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN); - - if (psta->qos_option) - qos_option = true; + qos_option = psta->qos_option; } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN); - - if (psta->qos_option) - qos_option = true; + qos_option = psta->qos_option; } else { return _FAIL; } From patchwork Fri Dec 30 18:06:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37742 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3009066wrt; Fri, 30 Dec 2022 10:09:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXv1r7N0dRn9BcGeWO5N0xs2rZos7Ih7NHUzqzJd9yE1WPmuSx20pDUb4jZhrol55U5ddTir X-Received: by 2002:a17:903:1306:b0:192:5ec4:c439 with SMTP id iy6-20020a170903130600b001925ec4c439mr26414853plb.16.1672423781587; Fri, 30 Dec 2022 10:09:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423781; cv=none; d=google.com; s=arc-20160816; b=yzmkMfRUbvSWXtkA6Qo62IN6OQ3cAtLH+/IH1biTQHuQRo1kS2r0dqJo86pcNU10J8 1vRqHHqiPnNFXVWi2pe2uunqsXpN4Kzwt4wPiVRo4PiOjhzrGiJNC1x/3CS+M7iGD1KE YuJNWTgsqk6IHlKUbZ6Znnpe7jdstqGZv3gZJF6OJo6TZd6NwP635yfddUVE9MNu1x0b AaEOY0artRcJ6Vr10mFvEOcvpnzn1vjy2vlCN3Bdb9I4TFjkisb+QjZsKE5fkm1rh/FC VT7TYzAmDu3sm0GJi7mAXB04S+/YKf9xQzpkgJ86WylMfIfCLdl3IMks9CUPY6OH0xev /MZQ== 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=X55gndd/0Q9CLm2qifGiPV7rz4wuiVHqhHVe73yz9gE=; b=h4HmF7rfGoLz3BQCH2wAjoUuq6hwBcsDlmG7c4OFIB8gXJ4+s6dS6k1X/BuFOpjlwv J2tGuQF8W1nVoastD8Dl4s+6U8O7sTPh7NLNaq27DqSns+HALwNkAaCYOMlp1h1/FmX0 +lH/68HHeWGUknoF0fmY8vPhifKgu1O7AymlYz4bo6qKoYks7MI2shJLLyetJTT/IZAs y66i90G7TocBsMFSoUWMLILffeNkVEfnJNwITGWfN3jY5Fe5HfoYqDNNQ944QE1zcWno cDDQPRP3l3U+OaHzZHQRLezyCUlmGgbB1/mUhaUDVSWJOCk8/wrpMJ9x9ZonOLjFaBGg Mv1w== 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 u9-20020a170902b28900b00186a8bd137fsi21664046plr.453.2022.12.30.10.09.29; Fri, 30 Dec 2022 10:09: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 S235519AbiL3SHv (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235456AbiL3SHY (ORCPT ); Fri, 30 Dec 2022 13:07: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 9B1F61C904 for ; Fri, 30 Dec 2022 10:07:20 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJml-0004rR-JM; Fri, 30 Dec 2022 19:07:15 +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/20] staging: r8188eu: remove unused bpending array Date: Fri, 30 Dec 2022 19:06:38 +0100 Message-Id: <20221230180646.91008-13-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663439436324786?= X-GMAIL-MSGID: =?utf-8?q?1753663439436324786?= The bpending array in struct xmit_buf is unused. Remove it. (struct xmit_buf is not part of the interface between the kernel driver and the device's firmware. It's safe to remove components from this struct.) Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/include/rtw_xmit.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index 6e7ebea5362d..b017f9293f86 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -203,7 +203,6 @@ struct xmit_buf { u32 ff_hwaddr; struct urb *pxmit_urb; dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */ - u8 bpending[8]; int last[8]; }; From patchwork Fri Dec 30 18:06:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37741 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008701wrt; Fri, 30 Dec 2022 10:08:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXuMyTN2TvlF9a9hXir4M2uYMXS+iZiy2zDwIhRBESnV7hE9wZl6ochHVkpmeEjqOghokDIN X-Received: by 2002:a17:903:3287:b0:186:59e9:a261 with SMTP id jh7-20020a170903328700b0018659e9a261mr32428173plb.43.1672423739236; Fri, 30 Dec 2022 10:08:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423739; cv=none; d=google.com; s=arc-20160816; b=ZLNyDbX5FpfbpBK6dxXyHo3kbHzP2ZhZZKjBKh0wNxUeMPkLZNb46tgkdbw8jS8AbC aqF15mGW71q/R4iCCrlCccupbDzg0CZ09mr2BhkkQlfs4OixXvmfPGt5tNVQ9eGjojz5 acnz5lR9cZeitPwzUjqBKCqYU75iFd7vj2DeNbB0vEA341/WM4wEpPaTEWPhxKKWw1z2 hlG8z3AcXg/1HnuYFKkxw5WZAtvH9r3zp2ZQGtg914DqKFJTkkXler4sQ73ZsZNhNwKy 3W8p1n4InXpbvLSeuK4aSvIuwCGw2otFfWYpn9YN6kNAWDz72A14vKPYPm50ZV7rPx0B 8xHg== 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=aG2J2nl9tOvFa0fU3SCSBn/7yEsWSysETiJp300dh0U=; b=YJIHEkFwCmalkoeOrACN3ZZIdjfoDWdlvEbuOPMRGDVDSvjqoMZUKFbD+CMnjFNNZB UNM6B/91webaIFdq1DQPEGv+wd7WyuqL573AbKhc8RAiLl2iPdFpyC6k0jW6D2UJxXwf V75EkYHkUxrgv3FqXrFMb27vM2mohzLO1wlHrjeNX+th1mwQqlAtZWrTp3SbMBGBlZ/Y kcIA/OXTtr3acHt8LNqmnPG9Xzq+J2+uHnJxBXxFQI/P4pNyac+wdYJcUCp3+MjSaYnV wqhg6ISj46Tgl+qA/lEpsS3Hvvgdq5ascHiYAHv1RPqVpcJX3KjXWWFHD7SLrh/4h4Qo TuFA== 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 t15-20020a170902e84f00b0018049a28eabsi24258375plg.617.2022.12.30.10.08.47; Fri, 30 Dec 2022 10:08:59 -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 S235531AbiL3SHy (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235158AbiL3SH3 (ORCPT ); Fri, 30 Dec 2022 13:07:29 -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 071181C908 for ; Fri, 30 Dec 2022 10:07:20 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmm-0004rR-Ce; Fri, 30 Dec 2022 19:07:16 +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/20] staging: r8188eu: remove unused dma_transfer_addr Date: Fri, 30 Dec 2022 19:06:39 +0100 Message-Id: <20221230180646.91008-14-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663394540736811?= X-GMAIL-MSGID: =?utf-8?q?1753663394540736811?= The dma_transfer_addr component in struct xmit_buf is initialised but not used. Remove it. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 1 - drivers/staging/r8188eu/include/rtw_xmit.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 0fef508408a7..bf4bb1e66985 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -41,7 +41,6 @@ static int rtw_xmit_resource_alloc(struct adapter *padapter, struct xmit_buf *px return -ENOMEM; pxmitbuf->pbuf = (u8 *)ALIGN((size_t)(pxmitbuf->pallocated_buf), XMITBUF_ALIGN_SZ); - pxmitbuf->dma_transfer_addr = 0; pxmitbuf->pxmit_urb = usb_alloc_urb(0, GFP_KERNEL); if (!pxmitbuf->pxmit_urb) { diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index b017f9293f86..1c4fbdf97a12 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -202,7 +202,6 @@ struct xmit_buf { struct submit_ctx *sctx; u32 ff_hwaddr; struct urb *pxmit_urb; - dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */ int last[8]; }; From patchwork Fri Dec 30 18:06:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37744 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3009166wrt; Fri, 30 Dec 2022 10:09:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXt+Lubuwv9Lx/MMyVc096IFcunLy7ozYW6pRFZietJtUwMu81877a8eaxuzXgWtvxryE5gH X-Received: by 2002:a05:6a20:1455:b0:ae:661c:5553 with SMTP id a21-20020a056a20145500b000ae661c5553mr49445400pzi.4.1672423796667; Fri, 30 Dec 2022 10:09:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423796; cv=none; d=google.com; s=arc-20160816; b=slxGP4JzCPJG1M1Crq9qtZEwcPtB+XbTt+FSHqfWbIwQ1rueBna6Dd+8sdwvoep3wh 8pmAuvgIENEOl9JgmOoYboFyVd+gT2TvvpIhs7x2i1H5D1A+oB6ly66bv3xJSl6Ln+an tKjAAKFsSA+ivLd+4If1qJbRA0JpvpPZ9oOos7biEs/UPM3c5vabFUzePVI6M3Jovk3p TxqmvabQ6RL1/yWUpqy43W0VW/UZghyAohy7jwR6emVT9/bthFQ4bo5XM6vibcEc7nZ1 sntmuvv9oP/sB2g1EAKDnNoLA7nkW7OJQo+HDg5kngWDg5pXQ5lQ9bP/4Duit/so+Xhm /5xg== 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=Fd5DdCMdy3e/d7+HgP1D/2alDHJE/5IFzTddicy151k=; b=Zmjq/gbCQT7S9ml+zGyi31qKtB+6bmnz6fRM0qsANHkhDU6aNeAK5Qk9IcTlS7aI1T aEdn3mYoi0/SjRQffx1OvfeCqoIOajfQGB95g5Ns5BHo7czlKoSfyamJq45LKy4+fUzQ H5S9v5vrReLTBYdJMYphnGR/pmJx8waqJ1IQG0fvAY+lHgGuMshKblN9Z2EavAsGH0mU AIEoYRmm6osL7WkbqJkUZqm6Qb1SG9U3/lljcd5UhtOBg5VXeBVcZpoUlVN8GJ0jH9XS dCiE1s7HbVeiPCIblW4KFbJP5v7R9nxcte+GUG/+1GiGDM2/uUbDwNpwHcarfePPGSph 3rDw== 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 m10-20020a63f60a000000b004779bfce4ccsi23684907pgh.452.2022.12.30.10.09.44; Fri, 30 Dec 2022 10:09:56 -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 S235130AbiL3SIE (ORCPT + 99 others); Fri, 30 Dec 2022 13:08:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235482AbiL3SHh (ORCPT ); Fri, 30 Dec 2022 13:07:37 -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 D68761C915 for ; Fri, 30 Dec 2022 10:07:22 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmn-0004rR-6j; Fri, 30 Dec 2022 19:07:17 +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/20] staging: r8188eu: bm_pending is not used Date: Fri, 30 Dec 2022 19:06:40 +0100 Message-Id: <20221230180646.91008-15-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663454830040182?= X-GMAIL-MSGID: =?utf-8?q?1753663454830040182?= The bm_pending queue in struct xmit_priv is initialised but not used. It can be removed. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 1 - drivers/staging/r8188eu/include/rtw_xmit.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index bf4bb1e66985..a3dccfa4d843 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -81,7 +81,6 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) rtw_init_queue(&pxmitpriv->bk_pending); rtw_init_queue(&pxmitpriv->vi_pending); rtw_init_queue(&pxmitpriv->vo_pending); - rtw_init_queue(&pxmitpriv->bm_pending); rtw_init_queue(&pxmitpriv->free_xmit_queue); diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index 1c4fbdf97a12..83638dede6e7 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -262,7 +262,6 @@ struct xmit_priv { struct __queue bk_pending; struct __queue vi_pending; struct __queue vo_pending; - struct __queue bm_pending; u8 *pallocated_frame_buf; u8 *pxmit_frame_buf; uint free_xmitframe_cnt; From patchwork Fri Dec 30 18:06:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37740 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008646wrt; Fri, 30 Dec 2022 10:08:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXv94BW/qodj0SlLnxsnHPqX/UZYCo7VpxASxgjexCJ9/7oSGQOAjl6X3L9eWlU+F4d4AVEf X-Received: by 2002:a17:90a:30c:b0:226:42ea:28cd with SMTP id 12-20020a17090a030c00b0022642ea28cdmr2919732pje.16.1672423731206; Fri, 30 Dec 2022 10:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423731; cv=none; d=google.com; s=arc-20160816; b=KzwKpQ5MMMLwZXSzy00l4Qgd8hROP6wqsfY1tvw+X7HjGF+pno4ollQBtsFDi1k/fG DyX4HRwtwVzT5AhVgGdIlZyo1zyp8tvWvF+864CnMjtyPiptREFvtB4IAx88LL/+aQAi w8ogWeLddfFQeG+00p1l51ua7fT3KYjQtT4JTGK9eEqFW6yu20xx0SvcudQSeazd4rK/ Le9Jg++msKyH8Q0xs5VXhqEUqC/GbWmhLJcTnWGZtg8e2TZ6iuxpiW8oMlxCUaikH0Ba 6Bwk0C6ETzQsn1nVOGXUvH0ecXajk1anwU/fMhrQFF3V3qcJf7y2oDga97Upbg+4maxv rd9g== 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=NvPkqCIfxLM80DDWKmbboo6wRRJbRJ+jDsVnRw9kG2I=; b=pP1x5z6ixT1b+315sufszLNGJS677ehX8Gfmh0yMhqaJbyQH4tPzSYJLvjiJxcaA89 cPKEQDWHnHChhXUxqQD3e5rRbB7g0QyNSZUo/DTPg1tpGZqNSD+oNqCf6ziHCvfLEjtX Tc4fBblDDK/k86PPOg3dEdk+9GmhSrVy3rXoOcP+VbwgobOJJI+fUTzuV3AYl7HqYWjI 9SWZazkrnnHZjOKmbiaCk8sjEP6zE2ztlkJNeXJubQxvOG+8oPK45eO12UXrxsZGCiJ+ WgBYCsmnRhcYkczgDeWY1T5c0q/wIfqDT6BEq/OK0iOiXA8b0CgqDP0VD3qOQ6E1D7bT sFZg== 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 v15-20020a17090a898f00b00223facc5d2csi21509492pjn.162.2022.12.30.10.08.39; Fri, 30 Dec 2022 10:08:51 -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 S235534AbiL3SH7 (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235477AbiL3SHf (ORCPT ); Fri, 30 Dec 2022 13:07:35 -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 B66961C90E for ; Fri, 30 Dec 2022 10:07:22 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmo-0004rR-0S; Fri, 30 Dec 2022 19:07:18 +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/20] staging: r8188eu: terminate_xmitthread_sema is not used Date: Fri, 30 Dec 2022 19:06:41 +0100 Message-Id: <20221230180646.91008-16-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663386212224144?= X-GMAIL-MSGID: =?utf-8?q?1753663386212224144?= Remove terminate_xmitthread_sema from struct xmit_priv. This semaphore is initialised but not used. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 1 - drivers/staging/r8188eu/include/rtw_xmit.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index a3dccfa4d843..ca6a1f4298a4 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -69,7 +69,6 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */ spin_lock_init(&pxmitpriv->lock); - sema_init(&pxmitpriv->terminate_xmitthread_sema, 0); /* * Please insert all the queue initializaiton using rtw_init_queue below diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index 83638dede6e7..ef1b7123e557 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -257,7 +257,6 @@ struct agg_pkt_info { struct xmit_priv { spinlock_t lock; - struct semaphore terminate_xmitthread_sema; struct __queue be_pending; struct __queue bk_pending; struct __queue vi_pending; From patchwork Fri Dec 30 18:06:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37743 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3009161wrt; Fri, 30 Dec 2022 10:09:56 -0800 (PST) X-Google-Smtp-Source: AMrXdXstoPsJpUfFbyrCN3kWkprqFjOSbapfGv7P2HpS3S+pU7E0ftRJSVJ0whWcLmaUdgzyTbVF X-Received: by 2002:a05:6a21:e385:b0:b3:4044:1503 with SMTP id cc5-20020a056a21e38500b000b340441503mr22481249pzc.52.1672423796383; Fri, 30 Dec 2022 10:09:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423796; cv=none; d=google.com; s=arc-20160816; b=r0dEU0SXqGIbQ76vJb/e+cnQn1hBfkuCataAzZNzjw8tuBLUnXXA1wZdAjnUWYs/Ey 145+K/N+wq/q+bBHL9o/PNUz7jXZBQVTMV11mtF4nt7i87f28vcYQt3ZNuoTKR9cD+97 0TcRYBmyeirfxQV/XAbwpubOblwxbXsDKd8oDpo0h/YtfqlbcBvRZ1HCUOk6DDl1kpaT fapPM3lQ/oRcYgXSgTDZefoExnsukqdH4Rg4VdTNLooTGqixJTZc+zvw66SxkX64qCM/ qSbjWWF8V8rn5mMvVcW+ve3Q9BllDblHsjJ+xduyAGhQedpwy/cCxcOkA4MLLPE+9oFz eU3A== 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=ewRGr2JoBImK4YhcVJfakNEtOotO9smawsZFBmt5CFk=; b=LbFzBtOxauCXAhC4XZ5ZGSitqleLCLkpNAZk9Cu1ULJo9Xw/wg/bFo2ioqcM1MbpJS crVMDI+l8wgwZgFZRr8VB25sjHIonYnyzSnj7xo7eLVnULOA715HHjU6gWCJOXX5SdmZ 0BzioRE7wkyuJd6/S7d4uN4dNJKZG5Y9q60v0mjFUnly+pe5NGsEO1LTMkiEz2k+rtwD lptsb8+Np+rytJmqkKlbQzcfUFxwyqSfMCFn7Kn88IKZ+IMSnZwBXKFl5nBm7A/onLoR c1r/YMtGkqblrpm/gQ0WTkV1Ygl6bHEbEe4rdQg+3TMFjLCqbeAJs71rsos/rBReFZj8 fJ/g== 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 l191-20020a6391c8000000b004978594b6desi18800838pge.609.2022.12.30.10.09.44; Fri, 30 Dec 2022 10:09:56 -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 S235548AbiL3SIJ (ORCPT + 99 others); Fri, 30 Dec 2022 13:08:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235494AbiL3SHj (ORCPT ); Fri, 30 Dec 2022 13:07:39 -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 A3CAD1C423 for ; Fri, 30 Dec 2022 10:07:24 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmo-0004rR-Qe; Fri, 30 Dec 2022 19:07:18 +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/20] staging: r8188eu: tx_retevt semaphore is not used Date: Fri, 30 Dec 2022 19:06:42 +0100 Message-Id: <20221230180646.91008-17-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663454720577356?= X-GMAIL-MSGID: =?utf-8?q?1753663454720577356?= Remove tx_retevt from struct xmit_priv. This semaphore is initialised but not used. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 2 -- drivers/staging/r8188eu/include/rtw_xmit.h | 1 - 2 files changed, 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index ca6a1f4298a4..eb47d8276eec 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -196,8 +196,6 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitpriv->txirp_cnt = 1; - sema_init(&pxmitpriv->tx_retevt, 0); - /* per AC pending irp */ pxmitpriv->beq_cnt = 0; pxmitpriv->bkq_cnt = 0; diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index ef1b7123e557..719424dd8a49 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -280,7 +280,6 @@ struct xmit_priv { 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. */ - struct semaphore tx_retevt;/* all tx return event; */ u8 txirp_cnt;/* */ struct tasklet_struct xmit_tasklet; /* per AC pending irp */ From patchwork Fri Dec 30 18:06:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37745 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3009454wrt; Fri, 30 Dec 2022 10:10:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXtnY/I61//iVjvXOP7jEyyBd48SAyuBQPHLhOp25xmeXYSOJ8xi8L0CmFyPF0+rGrXF5cIM X-Received: by 2002:a05:6402:1f0b:b0:46c:f903:7ea3 with SMTP id b11-20020a0564021f0b00b0046cf9037ea3mr28272923edb.32.1672423837791; Fri, 30 Dec 2022 10:10:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423837; cv=none; d=google.com; s=arc-20160816; b=EdGzWD95Dqcp672fW0CcVFTXeuk5r/+rIaIQl7ElMaeUpBISDkJ6hT0sw0qc6UCZl9 rMtHJt1kv/zBLQogBQgfuzi7yXbEgyKV29x1OFD2ousWDbcCkpQOwylyq8t2BWouxW5N HE16sEq3Ao8w1RFW2XfM4lpuU2gksKggglFRvJlyFy9BcN+3ymFLCKWK0ixa8cXDPLL/ drXNICFWdbzD47Qit8a7HlZtK9/mjPsv4JHufc5Io0aTCqGcFlB7vzJB0/LoSdY4+amY vxMs40Q6n2XKuRiQF2kI1FxBKJdpr4qqep+fDyfN3GVU5pJ6jE3WjkkkdVH1Hm/Sgpts TDrw== 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=F6tARZmh3GsbYj0cvlxSR+fRM8JSuizVJOiv36imjNQ=; b=ed6Rrw79hyWrnuS699dQtjQP7ltxbEFn/v3M6dzUX9NbEe0ZhF0/LSaQDwSgqztzOQ tlC2f3uueIbv8/N9FqyZDCfDQIUXFqabjmMb2g7jC8GvKQyEOagicJFguQ3wAtf5kVr6 OGTQ+VjAD7GpmviF/nzaeTMJj7t5ymm4QEshcPcP6yoj3aSxpCL73rWCx7Y6ZrgjuB0K NquYlGHuV/bXxZQ67IR6Y1717Cr6/RIT2Dp3gLGrp29uetc0hYfGRUOrj+fVffGH2MTR v5wtFJ5dk4EGI7oEwHyIDVWDDxXmrL3WOvKXr3I/DLAbebJp6oELU8+ibdq35IIJLMYA ldiw== 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 m12-20020a056402430c00b0046b6da777ecsi19745688edc.451.2022.12.30.10.10.13; Fri, 30 Dec 2022 10:10: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 S235561AbiL3SIN (ORCPT + 99 others); Fri, 30 Dec 2022 13:08:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47834 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235500AbiL3SHj (ORCPT ); Fri, 30 Dec 2022 13:07:39 -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 AEF1B1C920 for ; Fri, 30 Dec 2022 10:07:25 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmp-0004rR-Lg; Fri, 30 Dec 2022 19:07:19 +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/20] staging: r8188eu: remove unnecessary rtw_free_xmitframe call Date: Fri, 30 Dec 2022 19:06:43 +0100 Message-Id: <20221230180646.91008-18-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663498348115118?= X-GMAIL-MSGID: =?utf-8?q?1753663498348115118?= There's no need to call rtw_free_xmitframe before we dequeue the first frame. pxmitframe is always NULL at this point, rtw_free_xmitframe will do nothing in this case. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/rtl8188eu_xmit.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c index cf9779b86b9c..d1af76cc2091 100644 --- a/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c +++ b/drivers/staging/r8188eu/hal/rtl8188eu_xmit.c @@ -398,9 +398,6 @@ bool rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmit if (!pxmitbuf) return false; - /* 3 1. pick up first frame */ - rtw_free_xmitframe(pxmitpriv, pxmitframe); - pxmitframe = rtw_dequeue_xframe(pxmitpriv, pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry); if (!pxmitframe) { /* no more xmit frame, release xmit buffer */ From patchwork Fri Dec 30 18:06:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37746 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3009480wrt; Fri, 30 Dec 2022 10:10:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXtC7gLSxwvij8TqSFGdag/kjCzpQrHwhRgo9sjWAS/VcjyOrk/uJS7dZgToxMttG16VT9uA X-Received: by 2002:a17:906:4e48:b0:7c1:8f78:9562 with SMTP id g8-20020a1709064e4800b007c18f789562mr26442868ejw.50.1672423841797; Fri, 30 Dec 2022 10:10:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423841; cv=none; d=google.com; s=arc-20160816; b=e7AmlZd6LTZC4DGHWCnMY0L/qRdSy3KHsLTOuHWcQjONGHSf0EyYgMLDQmZLc++092 RJKb4vziZp+5WtEb/QeJXG1RiqGjfLIXFIA2+qXBop6Pj+rwPg9+Z28tJNs80fAoxOOp XsyEcuf+hi3pfVjx+33e3qodlu6gqbKF+aRRcn/Unj5o5gNzMzSgxFx7SYZw4grrg+eC +HUEOQkonh1b9cJAQOIPXD4wDAGvIqbPp/caKBqVYsKOtHZR3XXM0IRo+ORnE2hR0ISA Nu5McvTfbyAhH4sEx4gcbLX1kgqD3BJ4+ncdgvLvYqC33PPhiu+QhQ82btiQdDtHV5IJ HAaQ== 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=WEqY4t+U4WcG5l02SKx4PKieE1hjclBGXF9a64A8w6s=; b=TUzFqAK6Vtj0LCbTUCkD4UBQ9yZx1fLjeEfZuUAvma39Jw4vRStSs0Dy2oCcDJSGha ge9noeEwnjguiDuI5tsNgFDVNhMKN/CcM1x8bCfawOyKPgwe2sQsjsfjqjsxwE9LQFUA bnPvJVwvtrSVhsPT8ebGI3O27iuw8AMPb7UKfkc8n91ztGhWgKkzp9NTXwOdfSA28IfO bOG2wSNCH9q83bDjq785FWbZhW6TD2XjcuU9GE7r73D/VU3e59xcKTESyEWlGNtdUsIx oEh1aAlFjXeo16f3YJcaDfpH1yrjiJaKWqt7oyPrQ/Ro+QXJDKxyBRIUrPZ3Ofv18EMP HN5g== 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 hg5-20020a1709072cc500b0078dc5c888f1si19515414ejc.135.2022.12.30.10.10.18; Fri, 30 Dec 2022 10:10: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 S229681AbiL3SIS (ORCPT + 99 others); Fri, 30 Dec 2022 13:08:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235504AbiL3SHm (ORCPT ); Fri, 30 Dec 2022 13:07:42 -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 42F7F1C923 for ; Fri, 30 Dec 2022 10:07:26 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmq-0004rR-Dq; Fri, 30 Dec 2022 19:07:20 +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/20] staging: r8188eu: phwxmit parameter is unused Date: Fri, 30 Dec 2022 19:06:44 +0100 Message-Id: <20221230180646.91008-19-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663502044786025?= X-GMAIL-MSGID: =?utf-8?q?1753663502044786025?= Remove the unused function parameter phwxmit from function dequeue_one_xmitframe. 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 eb47d8276eec..347f06f48a37 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1399,7 +1399,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 hw_xmit *phwxmit, struct tx_servq *ptxservq, struct __queue *pframe_queue) +static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, struct tx_servq *ptxservq, struct __queue *pframe_queue) { struct list_head *xmitframe_plist, *xmitframe_phead; struct xmit_frame *pxmitframe = NULL; @@ -1452,7 +1452,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi pframe_queue = &ptxservq->sta_pending; - pxmitframe = dequeue_one_xmitframe(pxmitpriv, phwxmit, ptxservq, pframe_queue); + pxmitframe = dequeue_one_xmitframe(pxmitpriv, ptxservq, pframe_queue); if (pxmitframe) { phwxmit->accnt--; From patchwork Fri Dec 30 18:06:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37747 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3009507wrt; Fri, 30 Dec 2022 10:10:48 -0800 (PST) X-Google-Smtp-Source: AMrXdXssW31LmabAby4tIrf5tZbZohUGb1PLX2jkP4TnPubCUfmSo2NKxlozRf5e+SEg0MoBTkGG X-Received: by 2002:a17:907:7094:b0:844:1d1d:1fa with SMTP id yj20-20020a170907709400b008441d1d01famr28718574ejb.23.1672423848253; Fri, 30 Dec 2022 10:10:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423848; cv=none; d=google.com; s=arc-20160816; b=ufkiJocF1YHocjsC54VhhKG8Nlvcd+MR2HLz+oSN5Q7Rqedns2fMMAp7FRKPmtkJil tqVLzGqkWp3T4t75PXI/Izc8Z+FVv+fuG1abwzmJP/MUhbyswBZp7k6ycZNNdUt2kVsf ejD4jgnsqurZtozCNY7xYjB7A4dKZqcFW9d1nGd/ZjaF4aFI31IjefOo9HfzrpvR+aWG wh8i5kuH03ue9UVYaVJKSzoJvBvexSPPArC00AoAfXRoImJ+fYEbq1Un/mvKiyKVIHGH yzoCu5y+VUZa4cKw3ZzSFhaMLrKevyqmyPIg9no0LD6e3L3/hU9cHk6OZWLBN04ZEQyt Q51Q== 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=xZx0IVwYIoBXHAnWaZVYhyyUMkxj6BCf05rK4kumsxo=; b=yrDeu5Vvv74YTL/u3lnCkLch9nTLi+UJp58138S/Qhvd3fyNdA5lSOzBOp5Zz0vK/1 9MYN4lJUBf/IPtsJM+xa7InZM88HavRq9F/8XC1uC7sfY8vGI1cRX1u5dz8On3Pv9iY1 uUHAszN9MZO65H4maUR0ENizxKukBr0YUgZUPjDMw/gtlECc5T6lu4wh7COCksQXkDhI I80VnrAhvSW5Yc7Ap3ku0ow7F5FfoX2P1+lgd/KMi10JtYkHia6GI303cG9/rNn0HREz XpKely19Clg3vFeg6eJfodzraYaowi0Hly3W+m/9vexkhKyS7tWTqzQd/ERHnW+b2yNq 6TIQ== 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 dn7-20020a17090794c700b007c10f6a46c5si20230086ejc.219.2022.12.30.10.10.24; Fri, 30 Dec 2022 10:10: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 S235529AbiL3SIY (ORCPT + 99 others); Fri, 30 Dec 2022 13:08:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235506AbiL3SHm (ORCPT ); Fri, 30 Dec 2022 13:07:42 -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 678C41C92A for ; Fri, 30 Dec 2022 10:07:27 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmr-0004rR-91; Fri, 30 Dec 2022 19:07:21 +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/20] staging: r8188eu: rtw_init_hwxmits is not needed Date: Fri, 30 Dec 2022 19:06:45 +0100 Message-Id: <20221230180646.91008-20-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663508897745825?= X-GMAIL-MSGID: =?utf-8?q?1753663508897745825?= The _rtw_init_xmit_priv function calls rtw_alloc_hwxmits to allocate memory for pxmitpriv->hwxmits (this is an array of struct hw_xmit). This allocation uses kzalloc, the allocated memory is initialised with 0. After the allocation, _rtw_init_xmit_priv calls rtw_init_hwxmits to set an element of each hw_xmit to 0. This is not necessary, we can remove the rtw_init_hwxmits call and the now unused function rtw_init_hwxmits. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 10 ---------- drivers/staging/r8188eu/include/rtw_xmit.h | 1 - 2 files changed, 11 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 347f06f48a37..76b0839ca19d 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -189,8 +189,6 @@ int _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) if (rtw_alloc_hwxmits(padapter)) goto free_xmit_extbuf; - rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry); - for (i = 0; i < 4; i++) pxmitpriv->wmm_para_seq[i] = i; @@ -1570,14 +1568,6 @@ void rtw_free_hwxmits(struct adapter *padapter) kfree(hwxmits); } -void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry) -{ - int i; - - for (i = 0; i < entry; i++, phwxmit++) - phwxmit->accnt = 0; -} - 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 719424dd8a49..eafa693efc2f 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -345,7 +345,6 @@ void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv); s32 rtw_txframes_pending(struct adapter *padapter); s32 rtw_txframes_sta_ac_pending(struct adapter *padapter, struct pkt_attrib *pattrib); -void rtw_init_hwxmits(struct hw_xmit *phwxmit, int entry); 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); From patchwork Fri Dec 30 18:06:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37748 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3016949wrt; Fri, 30 Dec 2022 10:30:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXtvAk9JfRF1cI5JC0GDxeGO4Uz5L2g02juiIy/RnG/s1FMR1wVpucglwZPwIRfWX1xnNX02 X-Received: by 2002:a17:906:4483:b0:7fd:f028:50ff with SMTP id y3-20020a170906448300b007fdf02850ffmr26525541ejo.49.1672425008620; Fri, 30 Dec 2022 10:30:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672425008; cv=none; d=google.com; s=arc-20160816; b=kGWqakxG0xBmLVmmldjtu6tgf4pHCdymwiAjMEqc4gR+cmuiYIO17V1/EawYW7uRyJ oxSI+FBjbwPYwnt2lD+kc9J0Xs4sopcCfkUkvCfLeLqQEk/78pNNrA6bYqeyQjoElh6e 0RDHfaikHnvVjP6UCQ2KhBuu741kN7SBEpNWN5apctSZEXlXi5tufAlUwt8bYj2s6BeO g0VL7xGFlHN7nrcgcFdXAWygUMbPWPAc5lu+e8DaVUoGAx6wkYAVXUdsTlZLYYT+ae/g K4Id+Y9x5RBfYjwhNq0ganfVA/WosDZFqdr2SibX3jywXiJHdI0OyKXCw3aXfjgXXIE4 WLQw== 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=bf12/iHaDAIJFCQZ4L8lmA7j+muAn5rLCfj9dff+ess=; b=EZWFewawBQ81O2Dg8LPbo6VczXMPshEW2aJOf/GvfwKKHSXEDbK2DrSyP1gpyAl4qS 79HkoRzTvXTDg6O5QI5ub/BAyRZ0ImAq403DPUkO3cqrfCuGriHyo+hslmO+v/+Z+/nD JsapMCp+Tet371eKz/+30Aca+r0YBS+3YQ1MR3ZX2a4UZdUuGTgwAhr7W4db8XrsNrlm 43+Ynlxeo4yawFCPI906FwKVhiFUlCBfbAF8z3v41tgiaBykadkH0vFi3QWX3RcXPlMO Yx7KDmgMRbSQa+anFubcXnbfc6qoVnnEN4b6W/fiUYTeOGqnUV++K6YL0OeqmrknALZ4 4FOw== 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 sb41-20020a1709076da900b0083ad85fbd66si19550346ejc.577.2022.12.30.10.29.38; Fri, 30 Dec 2022 10:30: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 S235291AbiL3SQG (ORCPT + 99 others); Fri, 30 Dec 2022 13:16:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231449AbiL3SQE (ORCPT ); Fri, 30 Dec 2022 13:16: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 30E4E2DC2 for ; Fri, 30 Dec 2022 10:16:03 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJms-0004rR-8L; Fri, 30 Dec 2022 19:07:22 +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/20] staging: r8188eu: we use a constant number of hw_xmit entries Date: Fri, 30 Dec 2022 19:06:46 +0100 Message-Id: <20221230180646.91008-21-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753664725461751895?= X-GMAIL-MSGID: =?utf-8?q?1753664725461751895?= 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 76b0839ca19d..d224785a747b 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1417,7 +1417,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; @@ -1439,7 +1439,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); @@ -1543,9 +1543,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 = kzalloc(sizeof(struct hw_xmit) * pxmitpriv->hwxmit_entry, GFP_KERNEL); + pxmitpriv->hwxmits = kzalloc(sizeof(struct hw_xmit) * HWXMIT_ENTRY, 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 eafa693efc2f..f8f10c67b764 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -276,7 +276,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. */ @@ -334,7 +333,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);