diff options
author | Patrick McHardy <kaber@trash.net> | 2007-11-05 23:43:30 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-11-07 07:08:23 -0500 |
commit | d1332e0ab84479d941de5cf4a69c71dfd385a25e (patch) | |
tree | 0b929b9c8bd91199afde839bbc7a806cffe0817e /net | |
parent | 0795c65d9f8de2bf9a62ae1f56e928c6b5ed75ab (diff) |
[NETFILTER]: remove unneeded rcu_dereference() calls
As noticed by Paul McKenney, the rcu_dereference calls in the init path
of NAT modules are unneeded, remove them.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/netfilter/nf_nat_amanda.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_ftp.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_h323.c | 18 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_irc.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_pptp.c | 8 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_sip.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_tftp.c | 2 |
7 files changed, 19 insertions, 19 deletions
diff --git a/net/ipv4/netfilter/nf_nat_amanda.c b/net/ipv4/netfilter/nf_nat_amanda.c index 35a5aa69cd92..c31b87668250 100644 --- a/net/ipv4/netfilter/nf_nat_amanda.c +++ b/net/ipv4/netfilter/nf_nat_amanda.c | |||
@@ -69,7 +69,7 @@ static void __exit nf_nat_amanda_fini(void) | |||
69 | 69 | ||
70 | static int __init nf_nat_amanda_init(void) | 70 | static int __init nf_nat_amanda_init(void) |
71 | { | 71 | { |
72 | BUG_ON(rcu_dereference(nf_nat_amanda_hook)); | 72 | BUG_ON(nf_nat_amanda_hook != NULL); |
73 | rcu_assign_pointer(nf_nat_amanda_hook, help); | 73 | rcu_assign_pointer(nf_nat_amanda_hook, help); |
74 | return 0; | 74 | return 0; |
75 | } | 75 | } |
diff --git a/net/ipv4/netfilter/nf_nat_ftp.c b/net/ipv4/netfilter/nf_nat_ftp.c index e1a16d3ea4cb..a1d5d58a58bf 100644 --- a/net/ipv4/netfilter/nf_nat_ftp.c +++ b/net/ipv4/netfilter/nf_nat_ftp.c | |||
@@ -147,7 +147,7 @@ static void __exit nf_nat_ftp_fini(void) | |||
147 | 147 | ||
148 | static int __init nf_nat_ftp_init(void) | 148 | static int __init nf_nat_ftp_init(void) |
149 | { | 149 | { |
150 | BUG_ON(rcu_dereference(nf_nat_ftp_hook)); | 150 | BUG_ON(nf_nat_ftp_hook != NULL); |
151 | rcu_assign_pointer(nf_nat_ftp_hook, nf_nat_ftp); | 151 | rcu_assign_pointer(nf_nat_ftp_hook, nf_nat_ftp); |
152 | return 0; | 152 | return 0; |
153 | } | 153 | } |
diff --git a/net/ipv4/netfilter/nf_nat_h323.c b/net/ipv4/netfilter/nf_nat_h323.c index a868c8c41328..93e18ef114f2 100644 --- a/net/ipv4/netfilter/nf_nat_h323.c +++ b/net/ipv4/netfilter/nf_nat_h323.c | |||
@@ -544,15 +544,15 @@ static int nat_callforwarding(struct sk_buff *skb, struct nf_conn *ct, | |||
544 | /****************************************************************************/ | 544 | /****************************************************************************/ |
545 | static int __init init(void) | 545 | static int __init init(void) |
546 | { | 546 | { |
547 | BUG_ON(rcu_dereference(set_h245_addr_hook) != NULL); | 547 | BUG_ON(set_h245_addr_hook != NULL); |
548 | BUG_ON(rcu_dereference(set_h225_addr_hook) != NULL); | 548 | BUG_ON(set_h225_addr_hook != NULL); |
549 | BUG_ON(rcu_dereference(set_sig_addr_hook) != NULL); | 549 | BUG_ON(set_sig_addr_hook != NULL); |
550 | BUG_ON(rcu_dereference(set_ras_addr_hook) != NULL); | 550 | BUG_ON(set_ras_addr_hook != NULL); |
551 | BUG_ON(rcu_dereference(nat_rtp_rtcp_hook) != NULL); | 551 | BUG_ON(nat_rtp_rtcp_hook != NULL); |
552 | BUG_ON(rcu_dereference(nat_t120_hook) != NULL); | 552 | BUG_ON(nat_t120_hook != NULL); |
553 | BUG_ON(rcu_dereference(nat_h245_hook) != NULL); | 553 | BUG_ON(nat_h245_hook != NULL); |
554 | BUG_ON(rcu_dereference(nat_callforwarding_hook) != NULL); | 554 | BUG_ON(nat_callforwarding_hook != NULL); |
555 | BUG_ON(rcu_dereference(nat_q931_hook) != NULL); | 555 | BUG_ON(nat_q931_hook != NULL); |
556 | 556 | ||
557 | rcu_assign_pointer(set_h245_addr_hook, set_h245_addr); | 557 | rcu_assign_pointer(set_h245_addr_hook, set_h245_addr); |
558 | rcu_assign_pointer(set_h225_addr_hook, set_h225_addr); | 558 | rcu_assign_pointer(set_h225_addr_hook, set_h225_addr); |
diff --git a/net/ipv4/netfilter/nf_nat_irc.c b/net/ipv4/netfilter/nf_nat_irc.c index 766e2c16c6b9..fe6f9cef6c85 100644 --- a/net/ipv4/netfilter/nf_nat_irc.c +++ b/net/ipv4/netfilter/nf_nat_irc.c | |||
@@ -74,7 +74,7 @@ static void __exit nf_nat_irc_fini(void) | |||
74 | 74 | ||
75 | static int __init nf_nat_irc_init(void) | 75 | static int __init nf_nat_irc_init(void) |
76 | { | 76 | { |
77 | BUG_ON(rcu_dereference(nf_nat_irc_hook)); | 77 | BUG_ON(nf_nat_irc_hook != NULL); |
78 | rcu_assign_pointer(nf_nat_irc_hook, help); | 78 | rcu_assign_pointer(nf_nat_irc_hook, help); |
79 | return 0; | 79 | return 0; |
80 | } | 80 | } |
diff --git a/net/ipv4/netfilter/nf_nat_pptp.c b/net/ipv4/netfilter/nf_nat_pptp.c index e1385a099079..6817e7995f35 100644 --- a/net/ipv4/netfilter/nf_nat_pptp.c +++ b/net/ipv4/netfilter/nf_nat_pptp.c | |||
@@ -281,16 +281,16 @@ static int __init nf_nat_helper_pptp_init(void) | |||
281 | { | 281 | { |
282 | nf_nat_need_gre(); | 282 | nf_nat_need_gre(); |
283 | 283 | ||
284 | BUG_ON(rcu_dereference(nf_nat_pptp_hook_outbound)); | 284 | BUG_ON(nf_nat_pptp_hook_outbound != NULL); |
285 | rcu_assign_pointer(nf_nat_pptp_hook_outbound, pptp_outbound_pkt); | 285 | rcu_assign_pointer(nf_nat_pptp_hook_outbound, pptp_outbound_pkt); |
286 | 286 | ||
287 | BUG_ON(rcu_dereference(nf_nat_pptp_hook_inbound)); | 287 | BUG_ON(nf_nat_pptp_hook_inbound != NULL); |
288 | rcu_assign_pointer(nf_nat_pptp_hook_inbound, pptp_inbound_pkt); | 288 | rcu_assign_pointer(nf_nat_pptp_hook_inbound, pptp_inbound_pkt); |
289 | 289 | ||
290 | BUG_ON(rcu_dereference(nf_nat_pptp_hook_exp_gre)); | 290 | BUG_ON(nf_nat_pptp_hook_exp_gre != NULL); |
291 | rcu_assign_pointer(nf_nat_pptp_hook_exp_gre, pptp_exp_gre); | 291 | rcu_assign_pointer(nf_nat_pptp_hook_exp_gre, pptp_exp_gre); |
292 | 292 | ||
293 | BUG_ON(rcu_dereference(nf_nat_pptp_hook_expectfn)); | 293 | BUG_ON(nf_nat_pptp_hook_expectfn != NULL); |
294 | rcu_assign_pointer(nf_nat_pptp_hook_expectfn, pptp_nat_expected); | 294 | rcu_assign_pointer(nf_nat_pptp_hook_expectfn, pptp_nat_expected); |
295 | return 0; | 295 | return 0; |
296 | } | 296 | } |
diff --git a/net/ipv4/netfilter/nf_nat_sip.c b/net/ipv4/netfilter/nf_nat_sip.c index ce9edbcc01e3..3ca98971a1e9 100644 --- a/net/ipv4/netfilter/nf_nat_sip.c +++ b/net/ipv4/netfilter/nf_nat_sip.c | |||
@@ -293,8 +293,8 @@ static void __exit nf_nat_sip_fini(void) | |||
293 | 293 | ||
294 | static int __init nf_nat_sip_init(void) | 294 | static int __init nf_nat_sip_init(void) |
295 | { | 295 | { |
296 | BUG_ON(rcu_dereference(nf_nat_sip_hook)); | 296 | BUG_ON(nf_nat_sip_hook != NULL); |
297 | BUG_ON(rcu_dereference(nf_nat_sdp_hook)); | 297 | BUG_ON(nf_nat_sdp_hook != NULL); |
298 | rcu_assign_pointer(nf_nat_sip_hook, ip_nat_sip); | 298 | rcu_assign_pointer(nf_nat_sip_hook, ip_nat_sip); |
299 | rcu_assign_pointer(nf_nat_sdp_hook, ip_nat_sdp); | 299 | rcu_assign_pointer(nf_nat_sdp_hook, ip_nat_sdp); |
300 | return 0; | 300 | return 0; |
diff --git a/net/ipv4/netfilter/nf_nat_tftp.c b/net/ipv4/netfilter/nf_nat_tftp.c index 0ecec701cb44..1360a94766dd 100644 --- a/net/ipv4/netfilter/nf_nat_tftp.c +++ b/net/ipv4/netfilter/nf_nat_tftp.c | |||
@@ -43,7 +43,7 @@ static void __exit nf_nat_tftp_fini(void) | |||
43 | 43 | ||
44 | static int __init nf_nat_tftp_init(void) | 44 | static int __init nf_nat_tftp_init(void) |
45 | { | 45 | { |
46 | BUG_ON(rcu_dereference(nf_nat_tftp_hook)); | 46 | BUG_ON(nf_nat_tftp_hook != NULL); |
47 | rcu_assign_pointer(nf_nat_tftp_hook, help); | 47 | rcu_assign_pointer(nf_nat_tftp_hook, help); |
48 | return 0; | 48 | return 0; |
49 | } | 49 | } |