aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2006-06-26 02:51:37 -0400
committerDavid S. Miller <davem@davemloft.net>2006-06-26 02:51:37 -0400
commitf131072c3da84e70a0f65d71b3a3f6611c6a22bc (patch)
tree6b00e151ee25a9d20fc56c4aa5f947561a65047d /net/tipc/link.c
parente100ae92a68c55e7ba287866c20fe1b0ad4fcdee (diff)
[TIPC]: First phase of assert() cleanup
This also contains enhancements to simplify comparisons in name table publication removal algorithm and to simplify name table sanity checking when shutting down TIPC. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Per Liden <per.liden@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index ff40c9195fef..2efced5a673c 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -574,7 +574,6 @@ void tipc_link_wakeup_ports(struct link *l_ptr, int all)
574 break; 574 break;
575 list_del_init(&p_ptr->wait_list); 575 list_del_init(&p_ptr->wait_list);
576 p_ptr->congested_link = NULL; 576 p_ptr->congested_link = NULL;
577 assert(p_ptr->wakeup);
578 spin_lock_bh(p_ptr->publ.lock); 577 spin_lock_bh(p_ptr->publ.lock);
579 p_ptr->publ.congested = 0; 578 p_ptr->publ.congested = 0;
580 p_ptr->wakeup(&p_ptr->publ); 579 p_ptr->wakeup(&p_ptr->publ);
@@ -1246,8 +1245,6 @@ int tipc_link_send_sections_fast(struct port *sender,
1246 int res; 1245 int res;
1247 u32 selector = msg_origport(hdr) & 1; 1246 u32 selector = msg_origport(hdr) & 1;
1248 1247
1249 assert(destaddr != tipc_own_addr);
1250
1251again: 1248again:
1252 /* 1249 /*
1253 * Try building message using port's max_pkt hint. 1250 * Try building message using port's max_pkt hint.
@@ -2310,7 +2307,6 @@ void tipc_link_tunnel(struct link *l_ptr,
2310 memcpy(buf->data + INT_H_SIZE, (unchar *)msg, length); 2307 memcpy(buf->data + INT_H_SIZE, (unchar *)msg, length);
2311 dbg("%c->%c:", l_ptr->b_ptr->net_plane, tunnel->b_ptr->net_plane); 2308 dbg("%c->%c:", l_ptr->b_ptr->net_plane, tunnel->b_ptr->net_plane);
2312 msg_dbg(buf_msg(buf), ">SEND>"); 2309 msg_dbg(buf_msg(buf), ">SEND>");
2313 assert(tunnel);
2314 tipc_link_send_buf(tunnel, buf); 2310 tipc_link_send_buf(tunnel, buf);
2315} 2311}
2316 2312
@@ -2339,10 +2335,10 @@ void tipc_link_changeover(struct link *l_ptr)
2339 ORIGINAL_MSG, TIPC_OK, INT_H_SIZE, l_ptr->addr); 2335 ORIGINAL_MSG, TIPC_OK, INT_H_SIZE, l_ptr->addr);
2340 msg_set_bearer_id(&tunnel_hdr, l_ptr->peer_bearer_id); 2336 msg_set_bearer_id(&tunnel_hdr, l_ptr->peer_bearer_id);
2341 msg_set_msgcnt(&tunnel_hdr, msgcount); 2337 msg_set_msgcnt(&tunnel_hdr, msgcount);
2338
2342 if (!l_ptr->first_out) { 2339 if (!l_ptr->first_out) {
2343 struct sk_buff *buf; 2340 struct sk_buff *buf;
2344 2341
2345 assert(!msgcount);
2346 buf = buf_acquire(INT_H_SIZE); 2342 buf = buf_acquire(INT_H_SIZE);
2347 if (buf) { 2343 if (buf) {
2348 memcpy(buf->data, (unchar *)&tunnel_hdr, INT_H_SIZE); 2344 memcpy(buf->data, (unchar *)&tunnel_hdr, INT_H_SIZE);
@@ -2356,6 +2352,7 @@ void tipc_link_changeover(struct link *l_ptr)
2356 } 2352 }
2357 return; 2353 return;
2358 } 2354 }
2355
2359 while (crs) { 2356 while (crs) {
2360 struct tipc_msg *msg = buf_msg(crs); 2357 struct tipc_msg *msg = buf_msg(crs);
2361 2358
@@ -2455,11 +2452,15 @@ static int link_recv_changeover_msg(struct link **l_ptr,
2455 u32 msg_count = msg_msgcnt(tunnel_msg); 2452 u32 msg_count = msg_msgcnt(tunnel_msg);
2456 2453
2457 dest_link = (*l_ptr)->owner->links[msg_bearer_id(tunnel_msg)]; 2454 dest_link = (*l_ptr)->owner->links[msg_bearer_id(tunnel_msg)];
2458 assert(dest_link != *l_ptr);
2459 if (!dest_link) { 2455 if (!dest_link) {
2460 msg_dbg(tunnel_msg, "NOLINK/<REC<"); 2456 msg_dbg(tunnel_msg, "NOLINK/<REC<");
2461 goto exit; 2457 goto exit;
2462 } 2458 }
2459 if (dest_link == *l_ptr) {
2460 err("Unexpected changeover message on link <%s>\n",
2461 (*l_ptr)->name);
2462 goto exit;
2463 }
2463 dbg("%c<-%c:", dest_link->b_ptr->net_plane, 2464 dbg("%c<-%c:", dest_link->b_ptr->net_plane,
2464 (*l_ptr)->b_ptr->net_plane); 2465 (*l_ptr)->b_ptr->net_plane);
2465 *l_ptr = dest_link; 2466 *l_ptr = dest_link;