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);