summaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2006-03-20 22:36:47 -0800
committerDavid S. Miller <davem@davemloft.net>2006-03-20 22:36:47 -0800
commit1fc54d8f49c1270c584803437fb7c0ac543588c1 (patch)
tree13bccf49154e57986a7e218e38d243912aaea6d1 /net/tipc/node.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/node.c')
-rw-r--r--net/tipc/node.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 6d65010e5fa..9f23845d11b 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -155,7 +155,7 @@ static void node_select_active_links(struct node *n_ptr)
u32 i;
u32 highest_prio = 0;
- active[0] = active[1] = 0;
+ active[0] = active[1] = NULL;
for (i = 0; i < MAX_BEARERS; i++) {
struct link *l_ptr = n_ptr->links[i];
@@ -240,7 +240,7 @@ struct node *tipc_node_attach_link(struct link *l_ptr)
err("Attempt to create third link to %s\n",
addr_string_fill(addr_string, n_ptr->addr));
- return 0;
+ return NULL;
}
if (!n_ptr->links[bearer_id]) {
@@ -253,12 +253,12 @@ struct node *tipc_node_attach_link(struct link *l_ptr)
l_ptr->b_ptr->publ.name,
addr_string_fill(addr_string, l_ptr->addr));
}
- return 0;
+ return NULL;
}
void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr)
{
- n_ptr->links[l_ptr->b_ptr->identity] = 0;
+ n_ptr->links[l_ptr->b_ptr->identity] = NULL;
tipc_net.zones[tipc_zone(l_ptr->addr)]->links--;
n_ptr->link_cnt--;
}
@@ -424,7 +424,7 @@ static void node_lost_contact(struct node *n_ptr)
/* Notify subscribers */
list_for_each_entry_safe(ns, tns, &n_ptr->nsub, nodesub_list) {
- ns->node = 0;
+ ns->node = NULL;
list_del_init(&ns->nodesub_list);
tipc_k_signal((Handler)ns->handle_node_down,
(unsigned long)ns->usr_handle);
@@ -443,7 +443,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
u32 router_addr;
if (!tipc_addr_domain_valid(addr))
- return 0;
+ return NULL;
/* Look for direct link to destination processsor */
n_ptr = tipc_node_find(addr);
@@ -452,7 +452,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
/* Cluster local system nodes *must* have direct links */
if (!is_slave(addr) && in_own_cluster(addr))
- return 0;
+ return NULL;
/* Look for cluster local router with direct link to node */
router_addr = tipc_node_select_router(n_ptr, selector);
@@ -462,7 +462,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
/* Slave nodes can only be accessed within own cluster via a
known router with direct link -- if no router was found,give up */
if (is_slave(addr))
- return 0;
+ return NULL;
/* Inter zone/cluster -- find any direct link to remote cluster */
addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0);
@@ -475,7 +475,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector)
if (router_addr)
return tipc_node_select(router_addr, selector);
- return 0;
+ return NULL;
}
/**