diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2006-03-21 01:36:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-21 01:36:47 -0500 |
commit | 1fc54d8f49c1270c584803437fb7c0ac543588c1 (patch) | |
tree | 13bccf49154e57986a7e218e38d243912aaea6d1 /net/tipc/node.c | |
parent | edb2c34fb2683ff21c8a6bcc3e41c07a53601761 (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.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 6d65010e5fa1..9f23845d11b2 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) | |||
155 | u32 i; | 155 | u32 i; |
156 | u32 highest_prio = 0; | 156 | u32 highest_prio = 0; |
157 | 157 | ||
158 | active[0] = active[1] = 0; | 158 | active[0] = active[1] = NULL; |
159 | 159 | ||
160 | for (i = 0; i < MAX_BEARERS; i++) { | 160 | for (i = 0; i < MAX_BEARERS; i++) { |
161 | struct link *l_ptr = n_ptr->links[i]; | 161 | struct link *l_ptr = n_ptr->links[i]; |
@@ -240,7 +240,7 @@ struct node *tipc_node_attach_link(struct link *l_ptr) | |||
240 | 240 | ||
241 | err("Attempt to create third link to %s\n", | 241 | err("Attempt to create third link to %s\n", |
242 | addr_string_fill(addr_string, n_ptr->addr)); | 242 | addr_string_fill(addr_string, n_ptr->addr)); |
243 | return 0; | 243 | return NULL; |
244 | } | 244 | } |
245 | 245 | ||
246 | if (!n_ptr->links[bearer_id]) { | 246 | if (!n_ptr->links[bearer_id]) { |
@@ -253,12 +253,12 @@ struct node *tipc_node_attach_link(struct link *l_ptr) | |||
253 | l_ptr->b_ptr->publ.name, | 253 | l_ptr->b_ptr->publ.name, |
254 | addr_string_fill(addr_string, l_ptr->addr)); | 254 | addr_string_fill(addr_string, l_ptr->addr)); |
255 | } | 255 | } |
256 | return 0; | 256 | return NULL; |
257 | } | 257 | } |
258 | 258 | ||
259 | void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr) | 259 | void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr) |
260 | { | 260 | { |
261 | n_ptr->links[l_ptr->b_ptr->identity] = 0; | 261 | n_ptr->links[l_ptr->b_ptr->identity] = NULL; |
262 | tipc_net.zones[tipc_zone(l_ptr->addr)]->links--; | 262 | tipc_net.zones[tipc_zone(l_ptr->addr)]->links--; |
263 | n_ptr->link_cnt--; | 263 | n_ptr->link_cnt--; |
264 | } | 264 | } |
@@ -424,7 +424,7 @@ static void node_lost_contact(struct node *n_ptr) | |||
424 | 424 | ||
425 | /* Notify subscribers */ | 425 | /* Notify subscribers */ |
426 | list_for_each_entry_safe(ns, tns, &n_ptr->nsub, nodesub_list) { | 426 | list_for_each_entry_safe(ns, tns, &n_ptr->nsub, nodesub_list) { |
427 | ns->node = 0; | 427 | ns->node = NULL; |
428 | list_del_init(&ns->nodesub_list); | 428 | list_del_init(&ns->nodesub_list); |
429 | tipc_k_signal((Handler)ns->handle_node_down, | 429 | tipc_k_signal((Handler)ns->handle_node_down, |
430 | (unsigned long)ns->usr_handle); | 430 | (unsigned long)ns->usr_handle); |
@@ -443,7 +443,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector) | |||
443 | u32 router_addr; | 443 | u32 router_addr; |
444 | 444 | ||
445 | if (!tipc_addr_domain_valid(addr)) | 445 | if (!tipc_addr_domain_valid(addr)) |
446 | return 0; | 446 | return NULL; |
447 | 447 | ||
448 | /* Look for direct link to destination processsor */ | 448 | /* Look for direct link to destination processsor */ |
449 | n_ptr = tipc_node_find(addr); | 449 | n_ptr = tipc_node_find(addr); |
@@ -452,7 +452,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector) | |||
452 | 452 | ||
453 | /* Cluster local system nodes *must* have direct links */ | 453 | /* Cluster local system nodes *must* have direct links */ |
454 | if (!is_slave(addr) && in_own_cluster(addr)) | 454 | if (!is_slave(addr) && in_own_cluster(addr)) |
455 | return 0; | 455 | return NULL; |
456 | 456 | ||
457 | /* Look for cluster local router with direct link to node */ | 457 | /* Look for cluster local router with direct link to node */ |
458 | router_addr = tipc_node_select_router(n_ptr, selector); | 458 | router_addr = tipc_node_select_router(n_ptr, selector); |
@@ -462,7 +462,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector) | |||
462 | /* Slave nodes can only be accessed within own cluster via a | 462 | /* Slave nodes can only be accessed within own cluster via a |
463 | known router with direct link -- if no router was found,give up */ | 463 | known router with direct link -- if no router was found,give up */ |
464 | if (is_slave(addr)) | 464 | if (is_slave(addr)) |
465 | return 0; | 465 | return NULL; |
466 | 466 | ||
467 | /* Inter zone/cluster -- find any direct link to remote cluster */ | 467 | /* Inter zone/cluster -- find any direct link to remote cluster */ |
468 | addr = tipc_addr(tipc_zone(addr), tipc_cluster(addr), 0); | 468 | 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) | |||
475 | if (router_addr) | 475 | if (router_addr) |
476 | return tipc_node_select(router_addr, selector); | 476 | return tipc_node_select(router_addr, selector); |
477 | 477 | ||
478 | return 0; | 478 | return NULL; |
479 | } | 479 | } |
480 | 480 | ||
481 | /** | 481 | /** |