Commit a2de740a authored by Mika Kukkonen's avatar Mika Kukkonen Committed by Linus Torvalds

[PATCH] sparse: NULL vs 0 - net/*

parent a37f4989
......@@ -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
......
......@@ -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!");
......
......@@ -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");
......
......@@ -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:
......
......@@ -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);
......
......@@ -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:
......
......@@ -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;
}
......
......@@ -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 */
......
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