From 1fc54d8f49c1270c584803437fb7c0ac543588c1 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Mon, 20 Mar 2006 22:36:47 -0800 Subject: [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 Signed-off-by: Per Liden Signed-off-by: David S. Miller --- net/tipc/ref.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'net/tipc/ref.c') diff --git a/net/tipc/ref.c b/net/tipc/ref.c index 5a13c2d..33bbf50 100644 --- a/net/tipc/ref.c +++ b/net/tipc/ref.c @@ -61,7 +61,7 @@ * because entry 0's reference field has the form XXXX|1--1. */ -struct ref_table tipc_ref_table = { 0 }; +struct ref_table tipc_ref_table = { NULL }; static rwlock_t ref_table_lock = RW_LOCK_UNLOCKED; @@ -86,7 +86,7 @@ int tipc_ref_table_init(u32 requested_size, u32 start) write_lock_bh(&ref_table_lock); index_mask = sz - 1; for (i = sz - 1; i >= 0; i--) { - table[i].object = 0; + table[i].object = NULL; table[i].lock = SPIN_LOCK_UNLOCKED; table[i].data.next_plus_upper = (start & ~index_mask) + i - 1; } @@ -108,7 +108,7 @@ void tipc_ref_table_stop(void) return; vfree(tipc_ref_table.entries); - tipc_ref_table.entries = 0; + tipc_ref_table.entries = NULL; } /** @@ -173,7 +173,7 @@ void tipc_ref_discard(u32 ref) assert(entry->data.reference == ref); /* mark entry as unused */ - entry->object = 0; + entry->object = NULL; if (tipc_ref_table.first_free == 0) tipc_ref_table.first_free = index; else -- cgit v1.1