aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2006-03-21 01:36:47 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-21 01:36:47 -0500
commit1fc54d8f49c1270c584803437fb7c0ac543588c1 (patch)
tree13bccf49154e57986a7e218e38d243912aaea6d1 /net/tipc/link.c
parentedb2c34fb2683ff21c8a6bcc3e41c07a53601761 (diff)
[TIPC]: Fix simple sparse warnings
Tried to run the new tipc stack through sparse. Following patch fixes all cases where 0 was used as replacement of NULL. Use NULL to document this is a pointer and to silence sparse. This brough sparse warning count down with 127 to 24 warnings. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> 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.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 511872afa459..bbdca3beaaf9 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -573,7 +573,7 @@ void tipc_link_wakeup_ports(struct link *l_ptr, int all)
573 if (win <= 0) 573 if (win <= 0)
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 = 0; 576 p_ptr->congested_link = NULL;
577 assert(p_ptr->wakeup); 577 assert(p_ptr->wakeup);
578 spin_lock_bh(p_ptr->publ.lock); 578 spin_lock_bh(p_ptr->publ.lock);
579 p_ptr->publ.congested = 0; 579 p_ptr->publ.congested = 0;
@@ -1355,7 +1355,7 @@ again:
1355 fragm_crs = 0; 1355 fragm_crs = 0;
1356 fragm_rest = 0; 1356 fragm_rest = 0;
1357 sect_rest = 0; 1357 sect_rest = 0;
1358 sect_crs = 0; 1358 sect_crs = NULL;
1359 curr_sect = -1; 1359 curr_sect = -1;
1360 1360
1361 /* Prepare reusable fragment header: */ 1361 /* Prepare reusable fragment header: */
@@ -1549,7 +1549,7 @@ u32 tipc_link_push_packet(struct link *l_ptr)
1549 msg_dbg(buf_msg(buf), ">DEF-PROT>"); 1549 msg_dbg(buf_msg(buf), ">DEF-PROT>");
1550 l_ptr->unacked_window = 0; 1550 l_ptr->unacked_window = 0;
1551 buf_discard(buf); 1551 buf_discard(buf);
1552 l_ptr->proto_msg_queue = 0; 1552 l_ptr->proto_msg_queue = NULL;
1553 return TIPC_OK; 1553 return TIPC_OK;
1554 } else { 1554 } else {
1555 msg_dbg(buf_msg(buf), "|>DEF-PROT>"); 1555 msg_dbg(buf_msg(buf), "|>DEF-PROT>");
@@ -1860,7 +1860,7 @@ u32 tipc_link_defer_pkt(struct sk_buff **head,
1860 struct sk_buff **tail, 1860 struct sk_buff **tail,
1861 struct sk_buff *buf) 1861 struct sk_buff *buf)
1862{ 1862{
1863 struct sk_buff *prev = 0; 1863 struct sk_buff *prev = NULL;
1864 struct sk_buff *crs = *head; 1864 struct sk_buff *crs = *head;
1865 u32 seq_no = msg_seqno(buf_msg(buf)); 1865 u32 seq_no = msg_seqno(buf_msg(buf));
1866 1866
@@ -1953,7 +1953,7 @@ static void link_handle_out_of_seq_msg(struct link *l_ptr,
1953void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg, 1953void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg,
1954 u32 gap, u32 tolerance, u32 priority, u32 ack_mtu) 1954 u32 gap, u32 tolerance, u32 priority, u32 ack_mtu)
1955{ 1955{
1956 struct sk_buff *buf = 0; 1956 struct sk_buff *buf = NULL;
1957 struct tipc_msg *msg = l_ptr->pmsg; 1957 struct tipc_msg *msg = l_ptr->pmsg;
1958 u32 msg_size = sizeof(l_ptr->proto_msg); 1958 u32 msg_size = sizeof(l_ptr->proto_msg);
1959 1959
@@ -2426,7 +2426,7 @@ static int link_recv_changeover_msg(struct link **l_ptr,
2426 } 2426 }
2427 } 2427 }
2428exit: 2428exit:
2429 *buf = 0; 2429 *buf = NULL;
2430 buf_discard(tunnel_buf); 2430 buf_discard(tunnel_buf);
2431 return 0; 2431 return 0;
2432} 2432}
@@ -2586,13 +2586,13 @@ static inline void incr_timer_cnt(struct sk_buff *buf)
2586int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, 2586int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2587 struct tipc_msg **m) 2587 struct tipc_msg **m)
2588{ 2588{
2589 struct sk_buff *prev = 0; 2589 struct sk_buff *prev = NULL;
2590 struct sk_buff *fbuf = *fb; 2590 struct sk_buff *fbuf = *fb;
2591 struct tipc_msg *fragm = buf_msg(fbuf); 2591 struct tipc_msg *fragm = buf_msg(fbuf);
2592 struct sk_buff *pbuf = *pending; 2592 struct sk_buff *pbuf = *pending;
2593 u32 long_msg_seq_no = msg_long_msgno(fragm); 2593 u32 long_msg_seq_no = msg_long_msgno(fragm);
2594 2594
2595 *fb = 0; 2595 *fb = NULL;
2596 msg_dbg(fragm,"FRG<REC<"); 2596 msg_dbg(fragm,"FRG<REC<");
2597 2597
2598 /* Is there an incomplete message waiting for this fragment? */ 2598 /* Is there an incomplete message waiting for this fragment? */
@@ -2670,8 +2670,8 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2670 2670
2671static void link_check_defragm_bufs(struct link *l_ptr) 2671static void link_check_defragm_bufs(struct link *l_ptr)
2672{ 2672{
2673 struct sk_buff *prev = 0; 2673 struct sk_buff *prev = NULL;
2674 struct sk_buff *next = 0; 2674 struct sk_buff *next = NULL;
2675 struct sk_buff *buf = l_ptr->defragm_buf; 2675 struct sk_buff *buf = l_ptr->defragm_buf;
2676 2676
2677 if (!buf) 2677 if (!buf)
@@ -2750,19 +2750,19 @@ static struct link *link_find_link(const char *name, struct node **node)
2750 struct link *l_ptr; 2750 struct link *l_ptr;
2751 2751
2752 if (!link_name_validate(name, &link_name_parts)) 2752 if (!link_name_validate(name, &link_name_parts))
2753 return 0; 2753 return NULL;
2754 2754
2755 b_ptr = tipc_bearer_find_interface(link_name_parts.if_local); 2755 b_ptr = tipc_bearer_find_interface(link_name_parts.if_local);
2756 if (!b_ptr) 2756 if (!b_ptr)
2757 return 0; 2757 return NULL;
2758 2758
2759 *node = tipc_node_find(link_name_parts.addr_peer); 2759 *node = tipc_node_find(link_name_parts.addr_peer);
2760 if (!*node) 2760 if (!*node)
2761 return 0; 2761 return NULL;
2762 2762
2763 l_ptr = (*node)->links[b_ptr->identity]; 2763 l_ptr = (*node)->links[b_ptr->identity];
2764 if (!l_ptr || strcmp(l_ptr->name, name)) 2764 if (!l_ptr || strcmp(l_ptr->name, name))
2765 return 0; 2765 return NULL;
2766 2766
2767 return l_ptr; 2767 return l_ptr;
2768} 2768}