]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
ipv4: fib: Remove redundant argument
authorIdo Schimmel <idosch@mellanox.com>
Fri, 10 Mar 2017 07:56:19 +0000 (08:56 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Mar 2017 17:45:09 +0000 (09:45 -0800)
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>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip_fib.h
net/ipv4/fib_notifier.c
net/ipv4/fib_rules.c
net/ipv4/fib_trie.c

index 3ad87063a4754b9b5e25d4cf98d9ef47aa61f67b..d9cee9659978b5013b62b55d1f27312d99f6ed21 100644 (file)
@@ -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
index 91f8f181fa038a6167ea129ae3c68c71dd131cde..e0714d975947160565dfb1bd9a86bc7a592c73b1 100644 (file)
@@ -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();
 
index bbd57f099183c0a15cff85474c441fb91f0fa12a..289210903d5847ad7b88bbd0595e84edc8eb0f83 100644 (file)
@@ -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] = {
index 5639e8a42f1b6243d56d27a1839d7592f38b585e..1201409ba1dcb18ee028003b065410b87bf4a602 100644 (file)
@@ -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);
        }
 }