aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/cluster.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/cluster.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/cluster.c')
-rw-r--r--net/tipc/cluster.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/tipc/cluster.c b/net/tipc/cluster.c
index ab974ca19371..9fe45a4837df 100644
--- a/net/tipc/cluster.c
+++ b/net/tipc/cluster.c
@@ -48,7 +48,7 @@ void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
48 u32 lower, u32 upper); 48 u32 lower, u32 upper);
49struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); 49struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest);
50 50
51struct node **tipc_local_nodes = 0; 51struct node **tipc_local_nodes = NULL;
52struct node_map tipc_cltr_bcast_nodes = {0,{0,}}; 52struct node_map tipc_cltr_bcast_nodes = {0,{0,}};
53u32 tipc_highest_allowed_slave = 0; 53u32 tipc_highest_allowed_slave = 0;
54 54
@@ -61,7 +61,7 @@ struct cluster *tipc_cltr_create(u32 addr)
61 61
62 c_ptr = (struct cluster *)kmalloc(sizeof(*c_ptr), GFP_ATOMIC); 62 c_ptr = (struct cluster *)kmalloc(sizeof(*c_ptr), GFP_ATOMIC);
63 if (c_ptr == NULL) 63 if (c_ptr == NULL)
64 return 0; 64 return NULL;
65 memset(c_ptr, 0, sizeof(*c_ptr)); 65 memset(c_ptr, 0, sizeof(*c_ptr));
66 66
67 c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0); 67 c_ptr->addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0);
@@ -73,7 +73,7 @@ struct cluster *tipc_cltr_create(u32 addr)
73 c_ptr->nodes = (struct node **)kmalloc(alloc, GFP_ATOMIC); 73 c_ptr->nodes = (struct node **)kmalloc(alloc, GFP_ATOMIC);
74 if (c_ptr->nodes == NULL) { 74 if (c_ptr->nodes == NULL) {
75 kfree(c_ptr); 75 kfree(c_ptr);
76 return 0; 76 return NULL;
77 } 77 }
78 memset(c_ptr->nodes, 0, alloc); 78 memset(c_ptr->nodes, 0, alloc);
79 if (in_own_cluster(addr)) 79 if (in_own_cluster(addr))
@@ -91,7 +91,7 @@ struct cluster *tipc_cltr_create(u32 addr)
91 } 91 }
92 else { 92 else {
93 kfree(c_ptr); 93 kfree(c_ptr);
94 c_ptr = 0; 94 c_ptr = NULL;
95 } 95 }
96 96
97 return c_ptr; 97 return c_ptr;
@@ -204,7 +204,7 @@ struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
204 204
205 assert(!in_own_cluster(c_ptr->addr)); 205 assert(!in_own_cluster(c_ptr->addr));
206 if (!c_ptr->highest_node) 206 if (!c_ptr->highest_node)
207 return 0; 207 return NULL;
208 208
209 /* Start entry must be random */ 209 /* Start entry must be random */
210 while (mask > c_ptr->highest_node) { 210 while (mask > c_ptr->highest_node) {
@@ -222,7 +222,7 @@ struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
222 if (tipc_node_has_active_links(c_ptr->nodes[n_num])) 222 if (tipc_node_has_active_links(c_ptr->nodes[n_num]))
223 return c_ptr->nodes[n_num]; 223 return c_ptr->nodes[n_num];
224 } 224 }
225 return 0; 225 return NULL;
226} 226}
227 227
228/* 228/*