diff options
author | Tony Zelenoff <antonz@parallels.com> | 2012-03-08 18:35:39 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-05-08 13:17:23 -0400 |
commit | 031d7709f21c778bcb1eed96d790e82b3bee96b5 (patch) | |
tree | 5b0186ff11d30bc88ed0612905001bb5a06176f4 /net/netfilter | |
parent | 97138a1ca7917c11431293e668457f916a610ca5 (diff) |
netfilter: nf_ct_ecache: refactor notifier registration
* ret variable initialization removed as useless
* similar code strings concatenated and functions code
flow became more plain
Signed-off-by: Tony Zelenoff <antonz@parallels.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_conntrack_ecache.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c index b924f3a49a8e..e7be79e640de 100644 --- a/net/netfilter/nf_conntrack_ecache.c +++ b/net/netfilter/nf_conntrack_ecache.c | |||
@@ -84,7 +84,7 @@ EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events); | |||
84 | int nf_conntrack_register_notifier(struct net *net, | 84 | int nf_conntrack_register_notifier(struct net *net, |
85 | struct nf_ct_event_notifier *new) | 85 | struct nf_ct_event_notifier *new) |
86 | { | 86 | { |
87 | int ret = 0; | 87 | int ret; |
88 | struct nf_ct_event_notifier *notify; | 88 | struct nf_ct_event_notifier *notify; |
89 | 89 | ||
90 | mutex_lock(&nf_ct_ecache_mutex); | 90 | mutex_lock(&nf_ct_ecache_mutex); |
@@ -95,8 +95,7 @@ int nf_conntrack_register_notifier(struct net *net, | |||
95 | goto out_unlock; | 95 | goto out_unlock; |
96 | } | 96 | } |
97 | rcu_assign_pointer(net->ct.nf_conntrack_event_cb, new); | 97 | rcu_assign_pointer(net->ct.nf_conntrack_event_cb, new); |
98 | mutex_unlock(&nf_ct_ecache_mutex); | 98 | ret = 0; |
99 | return ret; | ||
100 | 99 | ||
101 | out_unlock: | 100 | out_unlock: |
102 | mutex_unlock(&nf_ct_ecache_mutex); | 101 | mutex_unlock(&nf_ct_ecache_mutex); |
@@ -121,7 +120,7 @@ EXPORT_SYMBOL_GPL(nf_conntrack_unregister_notifier); | |||
121 | int nf_ct_expect_register_notifier(struct net *net, | 120 | int nf_ct_expect_register_notifier(struct net *net, |
122 | struct nf_exp_event_notifier *new) | 121 | struct nf_exp_event_notifier *new) |
123 | { | 122 | { |
124 | int ret = 0; | 123 | int ret; |
125 | struct nf_exp_event_notifier *notify; | 124 | struct nf_exp_event_notifier *notify; |
126 | 125 | ||
127 | mutex_lock(&nf_ct_ecache_mutex); | 126 | mutex_lock(&nf_ct_ecache_mutex); |
@@ -132,8 +131,7 @@ int nf_ct_expect_register_notifier(struct net *net, | |||
132 | goto out_unlock; | 131 | goto out_unlock; |
133 | } | 132 | } |
134 | rcu_assign_pointer(net->ct.nf_expect_event_cb, new); | 133 | rcu_assign_pointer(net->ct.nf_expect_event_cb, new); |
135 | mutex_unlock(&nf_ct_ecache_mutex); | 134 | ret = 0; |
136 | return ret; | ||
137 | 135 | ||
138 | out_unlock: | 136 | out_unlock: |
139 | mutex_unlock(&nf_ct_ecache_mutex); | 137 | mutex_unlock(&nf_ct_ecache_mutex); |