Commit b3854e93 authored by Linus Torvalds's avatar Linus Torvalds

sparse: get rid of more integer/pointer confusion

Use NULL, not 0, where appropriate.
parent 9ee9887b
......@@ -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 @@ static int idr_get_new_above_int(struct idr *idp, void *ptr, int starting_id)
*/
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;
}
......
......@@ -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=/";
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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;
......
......@@ -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
......
......@@ -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;
......
......@@ -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: */
......
......@@ -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);
}
}
......@@ -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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment