提交 c28a1cf4 编写于 作者: S Stephen Hemminger 提交者: David S. Miller

[IPV4] fib_trie: Get rid of trie_init().

trie_init is worthless it is just zeroing stuff that is already zero!
Move the memset() down to make it obvious.
Signed-off-by: NStephen Hemminger <stephen.hemminger@vyatta.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 6db105db
...@@ -876,19 +876,6 @@ static struct tnode *halve(struct trie *t, struct tnode *tn) ...@@ -876,19 +876,6 @@ static struct tnode *halve(struct trie *t, struct tnode *tn)
} }
} }
static void trie_init(struct trie *t)
{
if (!t)
return;
t->size = 0;
rcu_assign_pointer(t->trie, NULL);
t->revision = 0;
#ifdef CONFIG_IP_FIB_TRIE_STATS
memset(&t->stats, 0, sizeof(struct trie_use_stats));
#endif
}
/* readside must use rcu_read_lock currently dump routines /* readside must use rcu_read_lock currently dump routines
via get_fa_head and dump */ via get_fa_head and dump */
...@@ -1980,11 +1967,9 @@ struct fib_table *fib_hash_init(u32 id) ...@@ -1980,11 +1967,9 @@ struct fib_table *fib_hash_init(u32 id)
tb->tb_flush = fn_trie_flush; tb->tb_flush = fn_trie_flush;
tb->tb_select_default = fn_trie_select_default; tb->tb_select_default = fn_trie_select_default;
tb->tb_dump = fn_trie_dump; tb->tb_dump = fn_trie_dump;
memset(tb->tb_data, 0, sizeof(struct trie));
t = (struct trie *) tb->tb_data; t = (struct trie *) tb->tb_data;
memset(t, 0, sizeof(*t));
trie_init(t);
if (id == RT_TABLE_LOCAL) if (id == RT_TABLE_LOCAL)
printk(KERN_INFO "IPv4 FIB: Using LC-trie version %s\n", VERSION); printk(KERN_INFO "IPv4 FIB: Using LC-trie version %s\n", VERSION);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册