diff options
author | Jon Maloy <jon.maloy@ericsson.com> | 2018-01-04 09:20:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-05 13:37:03 -0500 |
commit | d84d1b3b6b8c296de8d394002bc3a0ca910d7460 (patch) | |
tree | c57200a8b9cf7491f3845e1d3c0b64c45d2dadad /net/tipc | |
parent | 38266ca17c5f142a25d4563335e143cbd62e65a7 (diff) |
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 <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/group.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/net/tipc/group.c b/net/tipc/group.c index 0d743b98823f..fb7fe971e51b 100644 --- a/net/tipc/group.c +++ b/net/tipc/group.c | |||
@@ -355,12 +355,10 @@ void tipc_group_update_member(struct tipc_member *m, int len) | |||
355 | 355 | ||
356 | /* Sort member into small_window members' list */ | 356 | /* Sort member into small_window members' list */ |
357 | list_for_each_entry_safe(_m, tmp, &grp->small_win, small_win) { | 357 | list_for_each_entry_safe(_m, tmp, &grp->small_win, small_win) { |
358 | if (m->window > _m->window) | 358 | if (_m->window > m->window) |
359 | continue; | 359 | break; |
360 | list_add_tail(&m->small_win, &_m->small_win); | ||
361 | return; | ||
362 | } | 360 | } |
363 | list_add_tail(&m->small_win, &grp->small_win); | 361 | list_add_tail(&m->small_win, &_m->small_win); |
364 | } | 362 | } |
365 | 363 | ||
366 | void tipc_group_update_bc_members(struct tipc_group *grp, int len, bool ack) | 364 | 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, | |||
837 | m->instance = instance; | 835 | m->instance = instance; |
838 | TIPC_SKB_CB(skb)->orig_member = m->instance; | 836 | TIPC_SKB_CB(skb)->orig_member = m->instance; |
839 | tipc_group_proto_xmit(grp, m, GRP_JOIN_MSG, xmitq); | 837 | tipc_group_proto_xmit(grp, m, GRP_JOIN_MSG, xmitq); |
840 | if (m->window < ADV_IDLE) | 838 | tipc_group_update_member(m, 0); |
841 | tipc_group_update_member(m, 0); | ||
842 | else | ||
843 | list_del_init(&m->small_win); | ||
844 | } else if (event == TIPC_WITHDRAWN) { | 839 | } else if (event == TIPC_WITHDRAWN) { |
845 | if (!m) | 840 | if (!m) |
846 | goto drop; | 841 | goto drop; |