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/zone.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/zone.c')
-rw-r--r-- | net/tipc/zone.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/tipc/zone.c b/net/tipc/zone.c index 7c11f7f83a21..2803e1b4f170 100644 --- a/net/tipc/zone.c +++ b/net/tipc/zone.c | |||
@@ -44,11 +44,11 @@ | |||
44 | 44 | ||
45 | struct _zone *tipc_zone_create(u32 addr) | 45 | struct _zone *tipc_zone_create(u32 addr) |
46 | { | 46 | { |
47 | struct _zone *z_ptr = 0; | 47 | struct _zone *z_ptr = NULL; |
48 | u32 z_num; | 48 | u32 z_num; |
49 | 49 | ||
50 | if (!tipc_addr_domain_valid(addr)) | 50 | if (!tipc_addr_domain_valid(addr)) |
51 | return 0; | 51 | return NULL; |
52 | 52 | ||
53 | z_ptr = (struct _zone *)kmalloc(sizeof(*z_ptr), GFP_ATOMIC); | 53 | z_ptr = (struct _zone *)kmalloc(sizeof(*z_ptr), GFP_ATOMIC); |
54 | if (z_ptr != NULL) { | 54 | if (z_ptr != NULL) { |
@@ -114,10 +114,10 @@ struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref | |||
114 | u32 c_num; | 114 | u32 c_num; |
115 | 115 | ||
116 | if (!z_ptr) | 116 | if (!z_ptr) |
117 | return 0; | 117 | return NULL; |
118 | c_ptr = z_ptr->clusters[tipc_cluster(addr)]; | 118 | c_ptr = z_ptr->clusters[tipc_cluster(addr)]; |
119 | if (!c_ptr) | 119 | if (!c_ptr) |
120 | return 0; | 120 | return NULL; |
121 | n_ptr = tipc_cltr_select_node(c_ptr, ref); | 121 | n_ptr = tipc_cltr_select_node(c_ptr, ref); |
122 | if (n_ptr) | 122 | if (n_ptr) |
123 | return n_ptr; | 123 | return n_ptr; |
@@ -126,12 +126,12 @@ struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref | |||
126 | for (c_num = 1; c_num <= tipc_max_clusters; c_num++) { | 126 | for (c_num = 1; c_num <= tipc_max_clusters; c_num++) { |
127 | c_ptr = z_ptr->clusters[c_num]; | 127 | c_ptr = z_ptr->clusters[c_num]; |
128 | if (!c_ptr) | 128 | if (!c_ptr) |
129 | return 0; | 129 | return NULL; |
130 | n_ptr = tipc_cltr_select_node(c_ptr, ref); | 130 | n_ptr = tipc_cltr_select_node(c_ptr, ref); |
131 | if (n_ptr) | 131 | if (n_ptr) |
132 | return n_ptr; | 132 | return n_ptr; |
133 | } | 133 | } |
134 | return 0; | 134 | return NULL; |
135 | } | 135 | } |
136 | 136 | ||
137 | u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref) | 137 | u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref) |