* [PATCH] mISDN: Use list_count_nodes()
@ 2023-04-27 13:39 Christophe JAILLET
2023-04-28 8:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2023-04-27 13:39 UTC (permalink / raw)
To: Karsten Keil; +Cc: linux-kernel, kernel-janitors, Christophe JAILLET, netdev
count_list_member() really looks the same as list_count_nodes(), so use the
latter instead of hand writing it.
The first one return an int and the other a size_t, but that should be
fine. It is really unlikely that we get so many parties in a conference.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Un-tested
---
drivers/isdn/mISDN/dsp_cmx.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c
index 6d2088fbaf69..357b87592eb4 100644
--- a/drivers/isdn/mISDN/dsp_cmx.c
+++ b/drivers/isdn/mISDN/dsp_cmx.c
@@ -141,17 +141,6 @@
/*#define CMX_DELAY_DEBUG * gives rx-buffer delay overview */
/*#define CMX_TX_DEBUG * massive read/write on tx-buffer with content */
-static inline int
-count_list_member(struct list_head *head)
-{
- int cnt = 0;
- struct list_head *m;
-
- list_for_each(m, head)
- cnt++;
- return cnt;
-}
-
/*
* debug cmx memory structure
*/
@@ -1672,7 +1661,7 @@ dsp_cmx_send(void *arg)
mustmix = 0;
members = 0;
if (conf) {
- members = count_list_member(&conf->mlist);
+ members = list_count_nodes(&conf->mlist);
#ifdef CMX_CONF_DEBUG
if (conf->software && members > 1)
#else
@@ -1695,7 +1684,7 @@ dsp_cmx_send(void *arg)
/* loop all members that require conference mixing */
list_for_each_entry(conf, &conf_ilist, list) {
/* count members and check hardware */
- members = count_list_member(&conf->mlist);
+ members = list_count_nodes(&conf->mlist);
#ifdef CMX_CONF_DEBUG
if (conf->software && members > 1) {
#else
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mISDN: Use list_count_nodes()
2023-04-27 13:39 [PATCH] mISDN: Use list_count_nodes() Christophe JAILLET
@ 2023-04-28 8:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-28 8:50 UTC (permalink / raw)
To: Christophe JAILLET; +Cc: isdn, linux-kernel, kernel-janitors, netdev
Hello:
This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
On Thu, 27 Apr 2023 15:39:48 +0200 you wrote:
> count_list_member() really looks the same as list_count_nodes(), so use the
> latter instead of hand writing it.
>
> The first one return an int and the other a size_t, but that should be
> fine. It is really unlikely that we get so many parties in a conference.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>
> [...]
Here is the summary with links:
- mISDN: Use list_count_nodes()
https://git.kernel.org/netdev/net-next/c/e0807c430239
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-28 8:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27 13:39 [PATCH] mISDN: Use list_count_nodes() Christophe JAILLET
2023-04-28 8:50 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.