Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a2de740a
Commit
a2de740a
authored
Jun 30, 2004
by
Mika Kukkonen
Committed by
Linus Torvalds
Jun 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: NULL vs 0 - net/*
parent
a37f4989
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
43 deletions
+43
-43
net/core/net-sysfs.c
net/core/net-sysfs.c
+1
-1
net/core/sock.c
net/core/sock.c
+1
-1
net/ipv4/af_inet.c
net/ipv4/af_inet.c
+3
-3
net/ipv4/igmp.c
net/ipv4/igmp.c
+32
-32
net/ipv4/ip_output.c
net/ipv4/ip_output.c
+1
-1
net/ipv4/ip_sockglue.c
net/ipv4/ip_sockglue.c
+3
-3
net/sunrpc/pmap_clnt.c
net/sunrpc/pmap_clnt.c
+1
-1
net/sunrpc/svcsock.c
net/sunrpc/svcsock.c
+1
-1
No files found.
net/core/net-sysfs.c
View file @
a2de740a
...
...
@@ -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
...
...
net/core/sock.c
View file @
a2de740a
...
...
@@ -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!"
);
...
...
net/ipv4/af_inet.c
View file @
a2de740a
...
...
@@ -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
"
);
...
...
net/ipv4/igmp.c
View file @
a2de740a
...
...
@@ -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:
...
...
net/ipv4/ip_output.c
View file @
a2de740a
...
...
@@ -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
);
...
...
net/ipv4/ip_sockglue.c
View file @
a2de740a
...
...
@@ -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:
...
...
net/sunrpc/pmap_clnt.c
View file @
a2de740a
...
...
@@ -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
;
}
...
...
net/sunrpc/svcsock.c
View file @
a2de740a
...
...
@@ -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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment