* [PATCH net-next] wifi: mwifiex: Use list_count_nodes()
@ 2023-04-26 19:32 Christophe JAILLET
2023-04-27 17:47 ` Brian Norris
2023-05-05 12:02 ` Kalle Valo
0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2023-04-26 19:32 UTC (permalink / raw)
To: Amitkumar Karwar, Ganapathi Bhat, Sharvari Harisangam, Xinming Hu,
Kalle Valo, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-wireless,
netdev
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 <christophe.jaillet@wanadoo.fr>
---
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.
*/
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] wifi: mwifiex: Use list_count_nodes()
2023-04-26 19:32 [PATCH net-next] wifi: mwifiex: Use list_count_nodes() Christophe JAILLET
@ 2023-04-27 17:47 ` Brian Norris
2023-05-05 12:02 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Brian Norris @ 2023-04-27 17:47 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Amitkumar Karwar, Ganapathi Bhat, Sharvari Harisangam, Xinming Hu,
Kalle Valo, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-kernel, kernel-janitors, linux-wireless,
netdev
On Wed, Apr 26, 2023 at 09:32:36PM +0200, Christophe JAILLET wrote:
> 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 <christophe.jaillet@wanadoo.fr>
> ---
> drivers/net/wireless/marvell/mwifiex/11n.h | 4 ++--
> drivers/net/wireless/marvell/mwifiex/wmm.h | 15 ---------------
> 2 files changed, 2 insertions(+), 17 deletions(-)
FWIW:
Reviewed-by: Brian Norris <briannorris@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] wifi: mwifiex: Use list_count_nodes()
2023-04-26 19:32 [PATCH net-next] wifi: mwifiex: Use list_count_nodes() Christophe JAILLET
2023-04-27 17:47 ` Brian Norris
@ 2023-05-05 12:02 ` Kalle Valo
1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2023-05-05 12:02 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Amitkumar Karwar, Ganapathi Bhat, Sharvari Harisangam, Xinming Hu,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
linux-kernel, kernel-janitors, Christophe JAILLET, linux-wireless,
netdev
Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:
> 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 <christophe.jaillet@wanadoo.fr>
> Reviewed-by: Brian Norris <briannorris@chromium.org>
Patch applied to wireless-next.git, thanks.
c401bde6ead4 wifi: mwifiex: Use list_count_nodes()
--
https://patchwork.kernel.org/project/linux-wireless/patch/e77ed7f719787cb8836a93b6a6972f4147e40bc6.1682537509.git.christophe.jaillet@wanadoo.fr/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-05 12:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-26 19:32 [PATCH net-next] wifi: mwifiex: Use list_count_nodes() Christophe JAILLET
2023-04-27 17:47 ` Brian Norris
2023-05-05 12:02 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).