Skip to content

Commit

Permalink
netfilter: nf_ct_ecache: refactor notifier registration
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Tony Zelenoff authored and Pablo Neira Ayuso committed May 8, 2012
1 parent 97138a1 commit 031d770
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions net/netfilter/nf_conntrack_ecache.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ EXPORT_SYMBOL_GPL(nf_ct_deliver_cached_events);
int nf_conntrack_register_notifier(struct net *net,
struct nf_ct_event_notifier *new)
{
int ret = 0;
int ret;
struct nf_ct_event_notifier *notify;

mutex_lock(&nf_ct_ecache_mutex);
Expand All @@ -95,8 +95,7 @@ int nf_conntrack_register_notifier(struct net *net,
goto out_unlock;
}
rcu_assign_pointer(net->ct.nf_conntrack_event_cb, new);
mutex_unlock(&nf_ct_ecache_mutex);
return ret;
ret = 0;

out_unlock:
mutex_unlock(&nf_ct_ecache_mutex);
Expand All @@ -121,7 +120,7 @@ EXPORT_SYMBOL_GPL(nf_conntrack_unregister_notifier);
int nf_ct_expect_register_notifier(struct net *net,
struct nf_exp_event_notifier *new)
{
int ret = 0;
int ret;
struct nf_exp_event_notifier *notify;

mutex_lock(&nf_ct_ecache_mutex);
Expand All @@ -132,8 +131,7 @@ int nf_ct_expect_register_notifier(struct net *net,
goto out_unlock;
}
rcu_assign_pointer(net->ct.nf_expect_event_cb, new);
mutex_unlock(&nf_ct_ecache_mutex);
return ret;
ret = 0;

out_unlock:
mutex_unlock(&nf_ct_ecache_mutex);
Expand Down

0 comments on commit 031d770

Please sign in to comment.