From patchwork Wed Apr 26 19:32:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 87964 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp464691vqo; Wed, 26 Apr 2023 12:34:04 -0700 (PDT) X-Google-Smtp-Source: AKy350Y+e60kLbYePeiAJoLax+CTzDoUgeI5hBGYRb1OKbvq/Eafym99L6l/wTDmjnDwnmBvYhZC X-Received: by 2002:a05:6a00:248e:b0:63f:185a:6db2 with SMTP id c14-20020a056a00248e00b0063f185a6db2mr29489956pfv.18.1682537643987; Wed, 26 Apr 2023 12:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682537643; cv=none; d=google.com; s=arc-20160816; b=GkN9HUV9iHHTx9XxVs5ANHSbZ5UW63cp75JDa/CmaLi1fE9ylfxsGd4clz5r2BawDH AmhaIuwt5vwNEpOpIuUo2re7AkdEg0ST1HXhxEKsulzuGFHPbpyYjAgv0g3a28TIENC9 WUQxobcCnThs5Diw3epkd7W1BqHGhmKWTtb+X50/Y6DYHvI2jib8nx7gz09cbpvgabMr J6U1OsP2/m1TwLZuFD0MMYuIxl3wl446S2PGR6tlcV/Mxpl4w2Rjfu6U0uE8I1+1saQ1 sPEe0ZWZFK4WcD0/SzbqAreOkphllPgTpPraRrYA6c32rwtrUopjXW1PwcPc+z+db/8e RtNA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=wlSC+PaHzigWU6qH53gedUKBlVlTHJVVwjozTSCNOBU=; b=bO46a8zoL8aY2aEk7fhye8lI7CpLNALQnBQnD7v0qANFnTEdjxE8vY8Y5Hbjuum7Cv VeT1V6+Woo7JnNT5HdkeRHH2rWMt52+I/lQ12Clk7ZBZ5YhWgQAFf12PX+PH6qMGBDty g/osVJcVmFAUrqxxwxAz/YcfQtczHvOjj2KQr/Bks5ypdOs+pm15eaEwrXJaIgKViniF 8ZHfuRlI00LfwjkMjl1zY5pl0qIcDWBKVcZUKLCVWh5B+ndgdUZQWlfTcTo5iIcfvwoS Co3cmL6Cp0DRyELBi0Hx0eU2Z4CxszfhXPiqv5UJGv2Yo+e/hicxHlaQ6nB4X727r8Hk NRmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=AmxP+3a6; 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 h30-20020a056a00001e00b0063b7b7712a6si14799558pfk.255.2023.04.26.12.33.51; Wed, 26 Apr 2023 12:34:03 -0700 (PDT) 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; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=AmxP+3a6; 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 S239607AbjDZTcq (ORCPT + 99 others); Wed, 26 Apr 2023 15:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232651AbjDZTco (ORCPT ); Wed, 26 Apr 2023 15:32:44 -0400 Received: from smtp.smtpout.orange.fr (smtp-13.smtpout.orange.fr [80.12.242.13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CCFF26A5 for ; Wed, 26 Apr 2023 12:32:42 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id rksYpIGw9LshbrksYpobJM; Wed, 26 Apr 2023 21:32:40 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1682537560; bh=wlSC+PaHzigWU6qH53gedUKBlVlTHJVVwjozTSCNOBU=; h=From:To:Cc:Subject:Date; b=AmxP+3a6mMIwJvFptDVDzWQUXhJN1unPFvehlRknwq+U7+g9MrFJXY3biuB21/HkZ bPdPKYNGuaSzqdjMYp8YY+PhGyvH08FHLhIy+F7acXdx3UEKGH6PEzac1PUpOovlv9 w/tmurXhFpms5N+0huiLLvZ6qu5lnPav67elRlBRmaLBuvIYph3YGIga8H6oZN6H8x HYFgCdNNU/N2mbfaXWXh50NH85bu952Fs9OkTeEmRZH8Ikb0BQWZ/a69GrWjxmJXpP goJnEhGfJ99ae92lX5L+JtaHeVAYNAvG1gtrXmagknv78HmwK8Jg4Mo0ayg+9QYpad 5gF5cTiCsbM8A== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 26 Apr 2023 21:32:40 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Amitkumar Karwar , Ganapathi Bhat , Sharvari Harisangam , Xinming Hu , Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH net-next] wifi: mwifiex: Use list_count_nodes() Date: Wed, 26 Apr 2023 21:32:36 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1764268592160072136?= X-GMAIL-MSGID: =?utf-8?q?1764268592160072136?= mwifiex_wmm_list_len() is the same as list_count_nodes(), so use the latter instead of hand writing it. Turn 'ba_stream_num' and 'ba_stream_max' in size_t to keep the same type as what is returned by list_count_nodes(). Signed-off-by: Christophe JAILLET Reviewed-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/11n.h | 4 ++-- drivers/net/wireless/marvell/mwifiex/wmm.h | 15 --------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/11n.h b/drivers/net/wireless/marvell/mwifiex/11n.h index 94b5e3e4ba08..7738ebe1fec1 100644 --- a/drivers/net/wireless/marvell/mwifiex/11n.h +++ b/drivers/net/wireless/marvell/mwifiex/11n.h @@ -102,14 +102,14 @@ static inline u8 mwifiex_space_avail_for_new_ba_stream( { struct mwifiex_private *priv; u8 i; - u32 ba_stream_num = 0, ba_stream_max; + size_t ba_stream_num = 0, ba_stream_max; ba_stream_max = MWIFIEX_MAX_TX_BASTREAM_SUPPORTED; for (i = 0; i < adapter->priv_num; i++) { priv = adapter->priv[i]; if (priv) - ba_stream_num += mwifiex_wmm_list_len( + ba_stream_num += list_count_nodes( &priv->tx_ba_stream_tbl_ptr); } diff --git a/drivers/net/wireless/marvell/mwifiex/wmm.h b/drivers/net/wireless/marvell/mwifiex/wmm.h index 4f53a271dae0..d7659e688933 100644 --- a/drivers/net/wireless/marvell/mwifiex/wmm.h +++ b/drivers/net/wireless/marvell/mwifiex/wmm.h @@ -38,21 +38,6 @@ mwifiex_get_tid(struct mwifiex_ra_list_tbl *ptr) return skb->priority; } -/* - * This function gets the length of a list. - */ -static inline int -mwifiex_wmm_list_len(struct list_head *head) -{ - struct list_head *pos; - int count = 0; - - list_for_each(pos, head) - ++count; - - return count; -} - /* * This function checks if a RA list is empty or not. */