summaryrefslogtreecommitdiff
path: root/net/tipc
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2018-01-04 17:20:45 +0300
committerDavid S. Miller <davem@davemloft.net>2018-01-05 21:37:03 +0300
commitd84d1b3b6b8c296de8d394002bc3a0ca910d7460 (patch)
treec57200a8b9cf7491f3845e1d3c0b64c45d2dadad /net/tipc
parent38266ca17c5f142a25d4563335e143cbd62e65a7 (diff)
downloadlinux-d84d1b3b6b8c296de8d394002bc3a0ca910d7460.tar.xz
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.c13
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)
/* Sort member into small_window members' list */
list_for_each_entry_safe(_m, tmp, &grp->small_win, small_win) {
- if (m->window > _m->window)
- continue;
- list_add_tail(&m->small_win, &_m->small_win);
- return;
+ if (_m->window > m->window)
+ break;
}
- list_add_tail(&m->small_win, &grp->small_win);
+ list_add_tail(&m->small_win, &_m->small_win);
}
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,
m->instance = instance;
TIPC_SKB_CB(skb)->orig_member = m->instance;
tipc_group_proto_xmit(grp, m, GRP_JOIN_MSG, xmitq);
- if (m->window < ADV_IDLE)
- tipc_group_update_member(m, 0);
- else
- list_del_init(&m->small_win);
+ tipc_group_update_member(m, 0);
} else if (event == TIPC_WITHDRAWN) {
if (!m)
goto drop;