Skip to content

Commit d84d1b3

Browse files
Jon Maloydavem330
authored andcommitted
tipc: simplify small window members' sorting algorithm
We simplify the sorting algorithm in tipc_update_member(). We also make the remaining conditional call to this function unconditional, since the same condition now is tested for inside the said function. Acked-by: Ying Xue <[email protected]> Signed-off-by: Jon Maloy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 38266ca commit d84d1b3

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

net/tipc/group.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,10 @@ void tipc_group_update_member(struct tipc_member *m, int len)
355355

356356
/* Sort member into small_window members' list */
357357
list_for_each_entry_safe(_m, tmp, &grp->small_win, small_win) {
358-
if (m->window > _m->window)
359-
continue;
360-
list_add_tail(&m->small_win, &_m->small_win);
361-
return;
358+
if (_m->window > m->window)
359+
break;
362360
}
363-
list_add_tail(&m->small_win, &grp->small_win);
361+
list_add_tail(&m->small_win, &_m->small_win);
364362
}
365363

366364
void tipc_group_update_bc_members(struct tipc_group *grp, int len, bool ack)
@@ -837,10 +835,7 @@ void tipc_group_member_evt(struct tipc_group *grp,
837835
m->instance = instance;
838836
TIPC_SKB_CB(skb)->orig_member = m->instance;
839837
tipc_group_proto_xmit(grp, m, GRP_JOIN_MSG, xmitq);
840-
if (m->window < ADV_IDLE)
841-
tipc_group_update_member(m, 0);
842-
else
843-
list_del_init(&m->small_win);
838+
tipc_group_update_member(m, 0);
844839
} else if (event == TIPC_WITHDRAWN) {
845840
if (!m)
846841
goto drop;

0 commit comments

Comments
 (0)