diff options
author | Mika Kukkonen <mika@osdl.org> | 2004-06-30 01:51:44 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-30 01:51:44 -0700 |
commit | a2de740a7a3162a040694481b18a6118b195c9c6 (patch) | |
tree | ba380ba4f4dff6288a2a0b4fee68979d782d6188 /net | |
parent | a37f49897f7481741e6011f651c16a91afa9cd54 (diff) | |
download | history-a2de740a7a3162a040694481b18a6118b195c9c6.tar.gz |
[PATCH] sparse: NULL vs 0 - net/*
Diffstat (limited to 'net')
-rw-r--r-- | net/core/net-sysfs.c | 2 | ||||
-rw-r--r-- | net/core/sock.c | 2 | ||||
-rw-r--r-- | net/ipv4/af_inet.c | 6 | ||||
-rw-r--r-- | net/ipv4/igmp.c | 64 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_sockglue.c | 6 | ||||
-rw-r--r-- | net/sunrpc/pmap_clnt.c | 2 | ||||
-rw-r--r-- | net/sunrpc/svcsock.c | 2 |
8 files changed, 43 insertions, 43 deletions
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 20f1616508b858..46d26fc928f2f9 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c @@ -356,7 +356,7 @@ static int netdev_hotplug(struct class_device *cd, char **envp, if ((size <= 0) || (i >= num_envp)) return -ENOMEM; - envp[i] = 0; + envp[i] = NULL; return 0; } #endif diff --git a/net/core/sock.c b/net/core/sock.c index cd927e1fc2f114..64937e857ddc1c 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -667,7 +667,7 @@ void sk_free(struct sock *sk) void __init sk_init(void) { sk_cachep = kmem_cache_create("sock", sizeof(struct sock), 0, - SLAB_HWCACHE_ALIGN, 0, 0); + SLAB_HWCACHE_ALIGN, NULL, NULL); if (!sk_cachep) printk(KERN_CRIT "sk_init: Cannot create sock SLAB cache!"); diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 1939a76e63083b..aa46503d8629ef 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -1018,13 +1018,13 @@ static int __init inet_init(void) tcp_sk_cachep = kmem_cache_create("tcp_sock", sizeof(struct tcp_sock), 0, - SLAB_HWCACHE_ALIGN, 0, 0); + SLAB_HWCACHE_ALIGN, NULL, NULL); udp_sk_cachep = kmem_cache_create("udp_sock", sizeof(struct udp_sock), 0, - SLAB_HWCACHE_ALIGN, 0, 0); + SLAB_HWCACHE_ALIGN, NULL, NULL); raw4_sk_cachep = kmem_cache_create("raw4_sock", sizeof(struct raw_sock), 0, - SLAB_HWCACHE_ALIGN, 0, 0); + SLAB_HWCACHE_ALIGN, NULL, NULL); if (!tcp_sk_cachep || !udp_sk_cachep || !raw4_sk_cachep) printk(KERN_CRIT "inet_init: Can't create protocol sock SLAB caches!\n"); diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 149dc862776c55..d98038648150ac 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -279,7 +279,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size) skb = alloc_skb(size + LL_RESERVED_SPACE(dev), GFP_ATOMIC); if (skb == NULL) - return 0; + return NULL; { struct flowi fl = { .oif = dev->ifindex, @@ -288,13 +288,13 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size) .proto = IPPROTO_IGMP }; if (ip_route_output_key(&rt, &fl)) { kfree_skb(skb); - return 0; + return NULL; } } if (rt->rt_src == 0) { kfree_skb(skb); ip_rt_put(rt); - return 0; + return NULL; } skb->dst = &rt->u.dst; @@ -361,7 +361,7 @@ static struct sk_buff *add_grhead(struct sk_buff *skb, struct ip_mc_list *pmc, if (!skb) skb = igmpv3_newpack(dev, dev->mtu); if (!skb) - return 0; + return NULL; pgr = (struct igmpv3_grec *)skb_put(skb, sizeof(struct igmpv3_grec)); pgr->grec_type = type; pgr->grec_auxwords = 0; @@ -381,7 +381,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc, { struct net_device *dev = pmc->interface->dev; struct igmpv3_report *pih; - struct igmpv3_grec *pgr = 0; + struct igmpv3_grec *pgr = NULL; struct ip_sf_list *psf, *psf_next, *psf_prev, **psf_list; int scount, first, isquery, truncate; @@ -406,13 +406,13 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc, if (skb && AVAILABLE(skb) < sizeof(struct igmpv3_grec)+ sizeof(__u32)) { igmpv3_sendpack(skb); - skb = 0; /* add_grhead will get a new one */ + skb = NULL; /* add_grhead will get a new one */ } skb = add_grhead(skb, pmc, type, &pgr); } return skb; } - pih = skb ? (struct igmpv3_report *)skb->h.igmph : 0; + pih = skb ? (struct igmpv3_report *)skb->h.igmph : NULL; /* EX and TO_EX get a fresh packet, if needed */ if (truncate) { @@ -425,7 +425,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc, } first = 1; scount = 0; - psf_prev = 0; + psf_prev = NULL; for (psf=*psf_list; psf; psf=psf_next) { u32 *psrc; @@ -483,7 +483,7 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc, static int igmpv3_send_report(struct in_device *in_dev, struct ip_mc_list *pmc) { - struct sk_buff *skb = 0; + struct sk_buff *skb = NULL; int type; if (!pmc) { @@ -521,7 +521,7 @@ static void igmpv3_clear_zeros(struct ip_sf_list **ppsf) { struct ip_sf_list *psf_prev, *psf_next, *psf; - psf_prev = 0; + psf_prev = NULL; for (psf=*ppsf; psf; psf = psf_next) { psf_next = psf->sf_next; if (psf->sf_crcount == 0) { @@ -538,14 +538,14 @@ static void igmpv3_clear_zeros(struct ip_sf_list **ppsf) static void igmpv3_send_cr(struct in_device *in_dev) { struct ip_mc_list *pmc, *pmc_prev, *pmc_next; - struct sk_buff *skb = 0; + struct sk_buff *skb = NULL; int type, dtype; read_lock(&in_dev->lock); write_lock_bh(&in_dev->mc_lock); /* deleted MCA's */ - pmc_prev = 0; + pmc_prev = NULL; for (pmc=in_dev->mc_tomb; pmc; pmc=pmc_next) { pmc_next = pmc->next; if (pmc->sfmode == MCAST_INCLUDE) { @@ -681,7 +681,7 @@ static void igmp_gq_timer_expire(unsigned long data) struct in_device *in_dev = (struct in_device *)data; in_dev->mr_gq_running = 0; - igmpv3_send_report(in_dev, 0); + igmpv3_send_report(in_dev, NULL); __in_dev_put(in_dev); } @@ -976,7 +976,7 @@ static void igmpv3_add_delrec(struct in_device *in_dev, struct ip_mc_list *im) pmc->tomb = im->tomb; pmc->sources = im->sources; - im->tomb = im->sources = 0; + im->tomb = im->sources = NULL; for (psf=pmc->sources; psf; psf=psf->sf_next) psf->sf_crcount = pmc->crcount; } @@ -994,7 +994,7 @@ static void igmpv3_del_delrec(struct in_device *in_dev, __u32 multiaddr) struct ip_sf_list *psf, *psf_next; write_lock_bh(&in_dev->mc_lock); - pmc_prev = 0; + pmc_prev = NULL; for (pmc=in_dev->mc_tomb; pmc; pmc=pmc->next) { if (pmc->multiaddr == multiaddr) break; @@ -1023,7 +1023,7 @@ static void igmpv3_clear_delrec(struct in_device *in_dev) write_lock_bh(&in_dev->mc_lock); pmc = in_dev->mc_tomb; - in_dev->mc_tomb = 0; + in_dev->mc_tomb = NULL; write_unlock_bh(&in_dev->mc_lock); for (; pmc; pmc = nextpmc) { @@ -1039,7 +1039,7 @@ static void igmpv3_clear_delrec(struct in_device *in_dev) spin_lock_bh(&pmc->lock); psf = pmc->tomb; - pmc->tomb = 0; + pmc->tomb = NULL; spin_unlock_bh(&pmc->lock); for (; psf; psf=psf_next) { psf_next = psf->sf_next; @@ -1135,7 +1135,7 @@ void ip_mc_inc_group(struct in_device *in_dev, u32 addr) for (im=in_dev->mc_list; im; im=im->next) { if (im->multiaddr == addr) { im->users++; - ip_mc_add_src(in_dev, &addr, MCAST_EXCLUDE, 0, 0, 0); + ip_mc_add_src(in_dev, &addr, MCAST_EXCLUDE, 0, NULL, 0); goto out; } } @@ -1152,8 +1152,8 @@ void ip_mc_inc_group(struct in_device *in_dev, u32 addr) im->sfmode = MCAST_EXCLUDE; im->sfcount[MCAST_INCLUDE] = 0; im->sfcount[MCAST_EXCLUDE] = 1; - im->sources = 0; - im->tomb = 0; + im->sources = NULL; + im->tomb = NULL; im->crcount = 0; atomic_set(&im->refcnt, 1); spin_lock_init(&im->lock); @@ -1238,7 +1238,7 @@ void ip_mc_init_dev(struct in_device *in_dev) { ASSERT_RTNL(); - in_dev->mc_tomb = 0; + in_dev->mc_tomb = NULL; #ifdef CONFIG_IP_MULTICAST in_dev->mr_gq_running = 0; init_timer(&in_dev->mr_gq_timer); @@ -1339,7 +1339,7 @@ static int ip_mc_del1_src(struct ip_mc_list *pmc, int sfmode, struct ip_sf_list *psf, *psf_prev; int rv = 0; - psf_prev = 0; + psf_prev = NULL; for (psf=pmc->sources; psf; psf=psf->sf_next) { if (psf->sf_inaddr == *psfsrc) break; @@ -1453,7 +1453,7 @@ static int ip_mc_add1_src(struct ip_mc_list *pmc, int sfmode, { struct ip_sf_list *psf, *psf_prev; - psf_prev = 0; + psf_prev = NULL; for (psf=pmc->sources; psf; psf=psf->sf_next) { if (psf->sf_inaddr == *psfsrc) break; @@ -1594,12 +1594,12 @@ static void ip_mc_clear_src(struct ip_mc_list *pmc) nextpsf = psf->sf_next; kfree(psf); } - pmc->tomb = 0; + pmc->tomb = NULL; for (psf=pmc->sources; psf; psf=nextpsf) { nextpsf = psf->sf_next; kfree(psf); } - pmc->sources = 0; + pmc->sources = NULL; pmc->sfmode = MCAST_EXCLUDE; pmc->sfcount[MCAST_EXCLUDE] = 0; pmc->sfcount[MCAST_EXCLUDE] = 1; @@ -1673,13 +1673,13 @@ int ip_mc_leave_src(struct sock *sk, struct ip_mc_socklist *iml, if (iml->sflist == 0) { /* any-source empty exclude case */ return ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr, - iml->sfmode, 0, 0, 0); + iml->sfmode, 0, NULL, 0); } err = ip_mc_del_src(in_dev, &iml->multi.imr_multiaddr.s_addr, iml->sfmode, iml->sflist->sl_count, iml->sflist->sl_addr, 0); sock_kfree_s(sk, iml->sflist, IP_SFLSIZE(iml->sflist->sl_max)); - iml->sflist = 0; + iml->sflist = NULL; return err; } @@ -1731,7 +1731,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct struct ip_mreqn imr; u32 addr = mreqs->imr_multiaddr; struct ip_mc_socklist *pmc; - struct in_device *in_dev = 0; + struct in_device *in_dev = NULL; struct inet_opt *inet = inet_sk(sk); struct ip_sf_socklist *psl; int i, j, rv; @@ -1764,9 +1764,9 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct goto done; } else if (pmc->sfmode != omode) { /* allow mode switches for empty-set filters */ - ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 0, 0, 0); + ip_mc_add_src(in_dev, &mreqs->imr_multiaddr, omode, 0, NULL, 0); ip_mc_del_src(in_dev, &mreqs->imr_multiaddr, pmc->sfmode, 0, - 0, 0); + NULL, 0); pmc->sfmode = omode; } @@ -1896,7 +1896,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) goto done; } } else - newpsl = 0; + newpsl = NULL; psl = pmc->sflist; if (psl) { (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, @@ -1904,7 +1904,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) sock_kfree_s(sk, psl, IP_SFLSIZE(psl->sl_max)); } else (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, - 0, 0, 0); + 0, NULL, 0); pmc->sflist = newpsl; pmc->sfmode = msf->imsf_fmode; done: diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 2e04043e0e2d16..51b3b465a006df 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -512,7 +512,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*)) err = 0; offset = 0; frag = skb_shinfo(skb)->frag_list; - skb_shinfo(skb)->frag_list = 0; + skb_shinfo(skb)->frag_list = NULL; skb->data_len = first_len - skb_headlen(skb); skb->len = first_len; iph->tot_len = htons(first_len); diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 58ff4c0303c28d..8bb874be141afd 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c @@ -775,8 +775,8 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, extern int sysctl_optmem_max; extern int sysctl_igmp_max_msf; struct sockaddr_in *psin; - struct ip_msfilter *msf = 0; - struct group_filter *gsf = 0; + struct ip_msfilter *msf = NULL; + struct group_filter *gsf = NULL; int msize, i, ifindex; if (optlen < GROUP_FILTER_SIZE(0)) @@ -829,7 +829,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char __user *optval, msf->imsf_slist[i] = psin->sin_addr.s_addr; } kfree(gsf); - gsf = 0; + gsf = NULL; err = ip_mc_msfilter(sk, msf, ifindex); mc_msf_out: diff --git a/net/sunrpc/pmap_clnt.c b/net/sunrpc/pmap_clnt.c index 42c5ca84a998af..61bdc9754a06b3 100644 --- a/net/sunrpc/pmap_clnt.c +++ b/net/sunrpc/pmap_clnt.c @@ -58,7 +58,7 @@ rpc_getport(struct rpc_task *task, struct rpc_clnt *clnt) spin_lock(&pmap_lock); if (map->pm_binding) { - rpc_sleep_on(&map->pm_bindwait, task, NULL, 0); + rpc_sleep_on(&map->pm_bindwait, task, NULL, NULL); spin_unlock(&pmap_lock); return; } diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 7f9e6ce36a7452..ad353ae90634c6 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1016,7 +1016,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp) rqstp->rq_arg.page_len = len - rqstp->rq_arg.head[0].iov_len; } - rqstp->rq_skbuff = 0; + rqstp->rq_skbuff = NULL; rqstp->rq_prot = IPPROTO_TCP; /* Reset TCP read info */ |