Skip to content

Commit e0807c4

Browse files
tititiou36davem330
authored andcommitted
mISDN: Use list_count_nodes()
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> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6e98b09 commit e0807c4

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

drivers/isdn/mISDN/dsp_cmx.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,6 @@
141141
/*#define CMX_DELAY_DEBUG * gives rx-buffer delay overview */
142142
/*#define CMX_TX_DEBUG * massive read/write on tx-buffer with content */
143143

144-
static inline int
145-
count_list_member(struct list_head *head)
146-
{
147-
int cnt = 0;
148-
struct list_head *m;
149-
150-
list_for_each(m, head)
151-
cnt++;
152-
return cnt;
153-
}
154-
155144
/*
156145
* debug cmx memory structure
157146
*/
@@ -1672,7 +1661,7 @@ dsp_cmx_send(void *arg)
16721661
mustmix = 0;
16731662
members = 0;
16741663
if (conf) {
1675-
members = count_list_member(&conf->mlist);
1664+
members = list_count_nodes(&conf->mlist);
16761665
#ifdef CMX_CONF_DEBUG
16771666
if (conf->software && members > 1)
16781667
#else
@@ -1695,7 +1684,7 @@ dsp_cmx_send(void *arg)
16951684
/* loop all members that require conference mixing */
16961685
list_for_each_entry(conf, &conf_ilist, list) {
16971686
/* count members and check hardware */
1698-
members = count_list_member(&conf->mlist);
1687+
members = list_count_nodes(&conf->mlist);
16991688
#ifdef CMX_CONF_DEBUG
17001689
if (conf->software && members > 1) {
17011690
#else

0 commit comments

Comments
 (0)