[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>
This commit is contained in:
Sam Ravnborg 2006-03-20 22:36:47 -08:00 committed by David S. Miller
parent edb2c34fb2
commit 1fc54d8f49
21 changed files with 127 additions and 127 deletions

View file

@ -48,7 +48,7 @@ void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
u32 lower, u32 upper);
struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest);
struct node **tipc_local_nodes = 0;
struct node **tipc_local_nodes = NULL;
struct node_map tipc_cltr_bcast_nodes = {0,{0,}};
u32 tipc_highest_allowed_slave = 0;
@ -61,7 +61,7 @@ struct cluster *tipc_cltr_create(u32 addr)
c_ptr = (struct cluster *)kmalloc(sizeof(*c_ptr), GFP_ATOMIC);
if (c_ptr == NULL)
return 0;
return NULL;
memset(c_ptr, 0, sizeof(*c_ptr));
c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0);
@ -73,7 +73,7 @@ struct cluster *tipc_cltr_create(u32 addr)
c_ptr->nodes = (struct node **)kmalloc(alloc, GFP_ATOMIC);
if (c_ptr->nodes == NULL) {
kfree(c_ptr);
return 0;
return NULL;
}
memset(c_ptr->nodes, 0, alloc);
if (in_own_cluster(addr))
@ -91,7 +91,7 @@ struct cluster *tipc_cltr_create(u32 addr)
}
else {
kfree(c_ptr);
c_ptr = 0;
c_ptr = NULL;
}
return c_ptr;
@ -204,7 +204,7 @@ struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
assert(!in_own_cluster(c_ptr->addr));
if (!c_ptr->highest_node)
return 0;
return NULL;
/* Start entry must be random */
while (mask > c_ptr->highest_node) {
@ -222,7 +222,7 @@ struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
if (tipc_node_has_active_links(c_ptr->nodes[n_num]))
return c_ptr->nodes[n_num];
}
return 0;
return NULL;
}
/*