]> git.hungrycats.org Git - linux/commitdiff
sparse: get rid of more integer/pointer confusion
authorLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 29 Jun 2004 13:22:07 +0000 (06:22 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 29 Jun 2004 13:22:07 +0000 (06:22 -0700)
Use NULL, not 0, where appropriate.

lib/idr.c
lib/kobject.c
lib/rbtree.c
lib/vsprintf.c
net/ipv4/esp4.c
net/ipv4/netfilter/ip_conntrack_proto_tcp.c
net/key/af_key.c
net/sunrpc/auth_gss/svcauth_gss.c
net/sunrpc/stats.c
net/unix/af_unix.c

index cd4d1389fde0725fa0254134a97abc726e3584fb..6d1df639dab0e3c6c598cb74e2130575e33dd835 100644 (file)
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -120,7 +120,7 @@ static struct idr_layer *alloc_layer(struct idr *idp)
                return NULL;
        idp->id_free = p->ary[0];
        idp->id_free_cnt--;
-       p->ary[0] = 0;
+       p->ary[0] = NULL;
        spin_unlock(&idp->lock);
        return(p);
 }
@@ -251,7 +251,7 @@ build_up:
                         */
                        for (new = p; p && p != idp->top; new = p) {
                                p = p->ary[0];
-                               new->ary[0] = 0;
+                               new->ary[0] = NULL;
                                new->bitmap = new->count = 0;
                                free_layer(idp, new);
                        }
@@ -401,7 +401,7 @@ static  int init_id_cache(void)
 {
        if (!idr_layer_cache)
                idr_layer_cache = kmem_cache_create("idr_layer_cache", 
-                       sizeof(struct idr_layer), 0, 0, idr_cache_ctor, 0);
+                       sizeof(struct idr_layer), 0, 0, idr_cache_ctor, NULL);
        return 0;
 }
 
index 9b2519ee6e8cb978842cb066dcb74e8c8436fc3e..bcf4a9be0dcd35baf49a909fe395687e19658d47 100644 (file)
@@ -145,7 +145,7 @@ static void kset_hotplug(const char *action, struct kset *kset,
 
        argv [0] = hotplug_path;
        argv [1] = name;
-       argv [2] = 0;
+       argv [2] = NULL;
 
        /* minimal command environment */
        envp [i++] = "HOME=/";
index 61c12969be002c437597977ab650e22c4bcea11f..621552c344e77ae036133a1b8c9f9455ca8c8b78 100644 (file)
@@ -305,7 +305,7 @@ struct rb_node *rb_first(struct rb_root *root)
 
        n = root->rb_node;
        if (!n)
-               return 0;
+               return NULL;
        while (n->rb_left)
                n = n->rb_left;
        return n;
index 49692397908c4b16427203f62a8bbfdff6cf84ae..b1f5c9deede5f32ef90cebfe8ec064248eb42a09 100644 (file)
@@ -154,7 +154,7 @@ static char * number(char * buf, char * end, unsigned long long num, int base, i
        if (type & LEFT)
                type &= ~ZEROPAD;
        if (base < 2 || base > 36)
-               return 0;
+               return NULL;
        c = (type & ZEROPAD) ? '0' : ' ';
        sign = 0;
        if (type & SIGN) {
index 1fa9a9b98d83b55f37e0233fd303eb286f2de4d8..625c0f18b815f036f8430460ef35150b76c6eede 100644 (file)
@@ -121,7 +121,7 @@ int esp_output(struct sk_buff **pskb)
                top_iph->tot_len = htons((*pskb)->len + alen);
                top_iph->frag_off = iph->frag_off&htons(IP_DF);
                if (!(top_iph->frag_off))
-                       ip_select_ident(top_iph, dst, 0);
+                       ip_select_ident(top_iph, dst, NULL);
                top_iph->ttl = iph->ttl;        /* TTL disclosed */
                top_iph->check = 0;
                top_iph->saddr = x->props.saddr.a4;
index 1cc796556f27672a22bcdb8a5e4d565227232c3e..463cafa6692af7b316500811b2d7a4d3b3089ca6 100644 (file)
@@ -67,7 +67,7 @@ unsigned long ip_ct_tcp_timeout_time_wait =     2 MINS;
 unsigned long ip_ct_tcp_timeout_close =        10 SECS;
 
 static unsigned long * tcp_timeouts[]
-= { 0,                                 /*      TCP_CONNTRACK_NONE */
+= { NULL,                              /*      TCP_CONNTRACK_NONE */
     &ip_ct_tcp_timeout_established,    /*      TCP_CONNTRACK_ESTABLISHED,      */
     &ip_ct_tcp_timeout_syn_sent,       /*      TCP_CONNTRACK_SYN_SENT, */
     &ip_ct_tcp_timeout_syn_recv,       /*      TCP_CONNTRACK_SYN_RECV, */
@@ -76,7 +76,7 @@ static unsigned long * tcp_timeouts[]
     &ip_ct_tcp_timeout_close,          /*      TCP_CONNTRACK_CLOSE,    */
     &ip_ct_tcp_timeout_close_wait,     /*      TCP_CONNTRACK_CLOSE_WAIT,       */
     &ip_ct_tcp_timeout_last_ack,       /*      TCP_CONNTRACK_LAST_ACK, */
-    0,                                 /*      TCP_CONNTRACK_LISTEN */
+    NULL,                              /*      TCP_CONNTRACK_LISTEN */
  };
  
 #define sNO TCP_CONNTRACK_NONE
index 68497a25070e9d8970bc2e946e65de36bf1db81b..1553eb1fa3fa41ec8ca30576c6d7b8c92ce4d3f8 100644 (file)
@@ -2857,7 +2857,7 @@ static struct xfrm_mgr pfkeyv2_mgr =
 static void __exit ipsec_pfkey_exit(void)
 {
        xfrm_unregister_km(&pfkeyv2_mgr);
-       remove_proc_entry("net/pfkey", 0);
+       remove_proc_entry("net/pfkey", NULL);
        sock_unregister(PF_KEY);
 }
 
@@ -2865,7 +2865,7 @@ static int __init ipsec_pfkey_init(void)
 {
        sock_register(&pfkey_family_ops);
 #ifdef CONFIG_PROC_FS
-       create_proc_read_entry("net/pfkey", 0, 0, pfkey_read_proc, NULL);
+       create_proc_read_entry("net/pfkey", 0, NULL, pfkey_read_proc, NULL);
 #endif
        xfrm_register_km(&pfkeyv2_mgr);
        return 0;
index 55b2fd1048938828f3fb04f60b526542475e9ef7..8cb95cab79ddfa9a1a8a0f985dbab76f4af6205f 100644 (file)
@@ -763,7 +763,7 @@ svcauth_gss_accept(struct svc_rqst *rqstp, u32 *authp)
        if (!svcdata)
                goto auth_err;
        rqstp->rq_auth_data = svcdata;
-       svcdata->body_start = 0;
+       svcdata->body_start = NULL;
        svcdata->rsci = NULL;
        gc = &svcdata->clcred;
 
@@ -970,7 +970,7 @@ svcauth_gss_release(struct svc_rqst *rqstp)
                break;
        case RPC_GSS_SVC_INTEGRITY:
                p = gsd->body_start;
-               gsd->body_start = 0;
+               gsd->body_start = NULL;
                /* move accept_stat to right place: */
                memcpy(p, p + 2, 4);
                /* don't wrap in failure case: */
index 9a95d858aaaa3db0708ce309892b1337c7ac56ce..9b67dc19944c0d0c7d40e96852b19359fae5c181 100644 (file)
@@ -169,7 +169,7 @@ rpc_proc_exit(void)
        dprintk("RPC: unregistering /proc/net/rpc\n");
        if (proc_net_rpc) {
                proc_net_rpc = NULL;
-               remove_proc_entry("net/rpc", 0);
+               remove_proc_entry("net/rpc", NULL);
        }
 }
 
index e19475e6a0c22867572bfa2e170c654401c88511..c266bd6fa67a8b7c8a343e1e34a4718a7273168d 100644 (file)
@@ -2034,7 +2034,7 @@ static int __init af_unix_init(void)
         /* allocate our sock slab cache */
         unix_sk_cachep = kmem_cache_create("unix_sock",
                                           sizeof(struct unix_sock), 0,
-                                          SLAB_HWCACHE_ALIGN, 0, 0);
+                                          SLAB_HWCACHE_ALIGN, NULL, NULL);
         if (!unix_sk_cachep)
                 printk(KERN_CRIT
                         "af_unix_init: Cannot create unix_sock SLAB cache!\n");