From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, idosch@mellanox.com, mlxsw@mellanox.com,
ivecera@redhat.com, kuznet@ms2.inr.ac.ru, jmorris@namei.org,
yoshfuji@linux-ipv6.org, kaber@trash.net
Subject: [patch net-next 2/2] ipv4: fib: Remove redundant argument
Date: Fri, 10 Mar 2017 08:56:19 +0100 [thread overview]
Message-ID: <1489132579-12664-3-git-send-email-jiri@resnulli.us> (raw)
In-Reply-To: <1489132579-12664-1-git-send-email-jiri@resnulli.us>
From: Ido Schimmel <idosch@mellanox.com>
We always pass the same event type to fib_notify() and
fib_rules_notify(), so we can safely drop this argument.
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
include/net/ip_fib.h | 9 +++------
net/ipv4/fib_notifier.c | 4 ++--
net/ipv4/fib_rules.c | 5 ++---
net/ipv4/fib_trie.c | 15 ++++++---------
4 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index 3ad8706..d9cee96 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -238,14 +238,11 @@ int call_fib_notifier(struct notifier_block *nb, struct net *net,
int call_fib_notifiers(struct net *net, enum fib_event_type event_type,
struct fib_notifier_info *info);
-void fib_notify(struct net *net, struct notifier_block *nb,
- enum fib_event_type event_type);
+void fib_notify(struct net *net, struct notifier_block *nb);
#ifdef CONFIG_IP_MULTIPLE_TABLES
-void fib_rules_notify(struct net *net, struct notifier_block *nb,
- enum fib_event_type event_type);
+void fib_rules_notify(struct net *net, struct notifier_block *nb);
#else
-static inline void fib_rules_notify(struct net *net, struct notifier_block *nb,
- enum fib_event_type event_type)
+static inline void fib_rules_notify(struct net *net, struct notifier_block *nb)
{
}
#endif
diff --git a/net/ipv4/fib_notifier.c b/net/ipv4/fib_notifier.c
index 91f8f18..e0714d9 100644
--- a/net/ipv4/fib_notifier.c
+++ b/net/ipv4/fib_notifier.c
@@ -66,8 +66,8 @@ int register_fib_notifier(struct notifier_block *nb,
*/
rcu_read_lock();
for_each_net_rcu(net) {
- fib_rules_notify(net, nb, FIB_EVENT_RULE_ADD);
- fib_notify(net, nb, FIB_EVENT_ENTRY_ADD);
+ fib_rules_notify(net, nb);
+ fib_notify(net, nb);
}
rcu_read_unlock();
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index bbd57f0..2892109 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -172,13 +172,12 @@ static int call_fib_rule_notifiers(struct net *net,
return call_fib_notifiers(net, event_type, &info);
}
-void fib_rules_notify(struct net *net, struct notifier_block *nb,
- enum fib_event_type event_type)
+void fib_rules_notify(struct net *net, struct notifier_block *nb)
{
struct fib_notifier_info info;
if (net->ipv4.fib_has_custom_rules)
- call_fib_notifier(nb, net, event_type, &info);
+ call_fib_notifier(nb, net, FIB_EVENT_RULE_ADD, &info);
}
static const struct nla_policy fib4_rule_policy[FRA_MAX+1] = {
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 5639e8a..1201409 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1902,8 +1902,7 @@ int fib_table_flush(struct net *net, struct fib_table *tb)
}
static void fib_leaf_notify(struct net *net, struct key_vector *l,
- struct fib_table *tb, struct notifier_block *nb,
- enum fib_event_type event_type)
+ struct fib_table *tb, struct notifier_block *nb)
{
struct fib_alias *fa;
@@ -1919,22 +1918,21 @@ static void fib_leaf_notify(struct net *net, struct key_vector *l,
if (tb->tb_id != fa->tb_id)
continue;
- call_fib_entry_notifier(nb, net, event_type, l->key,
+ call_fib_entry_notifier(nb, net, FIB_EVENT_ENTRY_ADD, l->key,
KEYLENGTH - fa->fa_slen, fi, fa->fa_tos,
fa->fa_type, fa->tb_id);
}
}
static void fib_table_notify(struct net *net, struct fib_table *tb,
- struct notifier_block *nb,
- enum fib_event_type event_type)
+ struct notifier_block *nb)
{
struct trie *t = (struct trie *)tb->tb_data;
struct key_vector *l, *tp = t->kv;
t_key key = 0;
while ((l = leaf_walk_rcu(&tp, key)) != NULL) {
- fib_leaf_notify(net, l, tb, nb, event_type);
+ fib_leaf_notify(net, l, tb, nb);
key = l->key + 1;
/* stop in case of wrap around */
@@ -1943,8 +1941,7 @@ static void fib_table_notify(struct net *net, struct fib_table *tb,
}
}
-void fib_notify(struct net *net, struct notifier_block *nb,
- enum fib_event_type event_type)
+void fib_notify(struct net *net, struct notifier_block *nb)
{
unsigned int h;
@@ -1953,7 +1950,7 @@ void fib_notify(struct net *net, struct notifier_block *nb,
struct fib_table *tb;
hlist_for_each_entry_rcu(tb, head, tb_hlist)
- fib_table_notify(net, tb, nb, event_type);
+ fib_table_notify(net, tb, nb);
}
}
--
2.7.4
next prev parent reply other threads:[~2017-03-10 7:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-10 7:56 [patch net-next 0/2] ipv4: fib: FIB notifications cleanup Jiri Pirko
2017-03-10 7:56 ` [patch net-next 1/2] ipv4: fib: Move FIB notification code to a separate file Jiri Pirko
2017-03-10 16:31 ` David Ahern
2017-03-10 7:56 ` Jiri Pirko [this message]
2017-03-10 16:31 ` [patch net-next 2/2] ipv4: fib: Remove redundant argument David Ahern
2017-03-10 17:45 ` [patch net-next 0/2] ipv4: fib: FIB notifications cleanup David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1489132579-12664-3-git-send-email-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=idosch@mellanox.com \
--cc=ivecera@redhat.com \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).