[PATCH 1/9] get rid of trie_init

2008-01-11 Thread Stephen Hemminger
trie_init is worthless it is just zeroing stuff that is already
zero!  Move the memset() down to make it obvious.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>


--- a/net/ipv4/fib_trie.c   2008-01-11 21:56:47.0 -0800
+++ b/net/ipv4/fib_trie.c   2008-01-11 22:03:47.0 -0800
@@ -876,19 +876,6 @@ nomem:
}
 }
 
-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
  via get_fa_head and dump */
 
@@ -1977,11 +1964,9 @@ struct fib_table *fib_hash_init(u32 id)
tb->tb_flush = fn_trie_flush;
tb->tb_select_default = fn_trie_select_default;
tb->tb_dump = fn_trie_dump;
-   memset(tb->tb_data, 0, sizeof(struct trie));
 
t = (struct trie *) tb->tb_data;
-
-   trie_init(t);
+   memset(t, 0, sizeof(*t));
 
if (id == RT_TABLE_LOCAL)
printk(KERN_INFO "IPv4 FIB: Using LC-trie version %s\n", 
VERSION);

-- 
Stephen Hemminger <[EMAIL PROTECTED]>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/9] get rid of trie_init

2008-01-12 Thread David Miller
From: Stephen Hemminger <[EMAIL PROTECTED]>
Date: Fri, 11 Jan 2008 22:45:14 -0800

> trie_init is worthless it is just zeroing stuff that is already
> zero!  Move the memset() down to make it obvious.
> 
> Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html