tipc: fix integer as NULL pointer sparse warnings in tipc
authorHarvey Harrison <harvey.harrison@gmail.com>
Mon, 25 Feb 2008 02:38:31 +0000 (18:38 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 Feb 2008 02:38:31 +0000 (18:38 -0800)
net/tipc/cluster.c:145:2: warning: Using plain integer as NULL pointer
net/tipc/link.c:3254:36: warning: Using plain integer as NULL pointer
net/tipc/ref.c:151:15: warning: Using plain integer as NULL pointer
net/tipc/zone.c:85:2: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/cluster.c
net/tipc/link.c
net/tipc/ref.c
net/tipc/zone.c

index 95b373913aa0dd21ae33a73dc730b92fd2e5c2fa..4bb3404f610b4c7f96cb74666d894efc2e2aae57 100644 (file)
@@ -142,7 +142,7 @@ void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr)
                max_n_num = tipc_highest_allowed_slave;
        assert(n_num > 0);
        assert(n_num <= max_n_num);
-       assert(c_ptr->nodes[n_num] == 0);
+       assert(c_ptr->nodes[n_num] == NULL);
        c_ptr->nodes[n_num] = n_ptr;
        if (n_num > c_ptr->highest_node)
                c_ptr->highest_node = n_num;
index 1b17fecee74784cd2a2f701a374eb0769607fb29..cefa99824c58a1a1f061db74b6491ec09805d7cf 100644 (file)
@@ -3251,7 +3251,7 @@ static void link_print(struct link *l_ptr, struct print_buf *buf,
                if ((mod(msg_seqno(buf_msg(l_ptr->last_out)) -
                         msg_seqno(buf_msg(l_ptr->first_out)))
                     != (l_ptr->out_queue_size - 1))
-                   || (l_ptr->last_out->next != 0)) {
+                   || (l_ptr->last_out->next != NULL)) {
                        tipc_printf(buf, "\nSend queue inconsistency\n");
                        tipc_printf(buf, "first_out= %x ", l_ptr->first_out);
                        tipc_printf(buf, "next_out= %x ", l_ptr->next_out);
index 6704a58c785162e40989711bd061c44e6b8f25e8..c38744c96ed144509b34a4751c8143cfdbd149e1 100644 (file)
@@ -148,7 +148,7 @@ u32 tipc_ref_acquire(void *object, spinlock_t **lock)
                reference = (next_plus_upper & ~index_mask) + index;
                entry->data.reference = reference;
                entry->object = object;
-               if (lock != 0)
+               if (lock != NULL)
                        *lock = &entry->lock;
                spin_unlock_bh(&entry->lock);
        }
index 114e173f11a5fbbb6b459219984778fe44ebd2d8..3506f856344162669d43a7b63ffebb6b04da0807 100644 (file)
@@ -82,7 +82,7 @@ void tipc_zone_attach_cluster(struct _zone *z_ptr, struct cluster *c_ptr)
 
        assert(c_ptr->addr);
        assert(c_num <= tipc_max_clusters);
-       assert(z_ptr->clusters[c_num] == 0);
+       assert(z_ptr->clusters[c_num] == NULL);
        z_ptr->clusters[c_num] = c_ptr;
 }