aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-01-13 00:27:41 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:01:58 -0500
commit112d8cfcbf4f5ef0cf669cb5864f1206972076d6 (patch)
treea47c7a31adb9fc95f47688717d4639ef832d8974
parentb9aed45507b657abab0b88da2c9b509a9dc462b1 (diff)
[FIB]: Reduce text size of net/ipv4/fib_trie.o
In struct tnode, we use two fields of 5 bits for 'pos' and 'bits'. Switching to plain 'unsigned char' (8 bits) take the same space because of compiler alignments, and reduce text size by 435 bytes on i386. On i386 : $ size net/ipv4/fib_trie.o.before_patch net/ipv4/fib_trie.o text data bss dec hex filename 13714 4 64 13782 35d6 net/ipv4/fib_trie.o.before 13279 4 64 13347 3423 net/ipv4/fib_trie.o Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Acked-by: Stephen Hemminger <stephen.hemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv4/fib_trie.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 3e94a4dddb0c..350904c233ee 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -118,8 +118,8 @@ struct leaf_info {
118struct tnode { 118struct tnode {
119 t_key key; 119 t_key key;
120 unsigned long parent; 120 unsigned long parent;
121 unsigned short pos:5; /* 2log(KEYLENGTH) bits needed */ 121 unsigned char pos; /* 2log(KEYLENGTH) bits needed */
122 unsigned short bits:5; /* 2log(KEYLENGTH) bits needed */ 122 unsigned char bits; /* 2log(KEYLENGTH) bits needed */
123 unsigned short full_children; /* KEYLENGTH bits needed */ 123 unsigned short full_children; /* KEYLENGTH bits needed */
124 unsigned short empty_children; /* KEYLENGTH bits needed */ 124 unsigned short empty_children; /* KEYLENGTH bits needed */
125 struct rcu_head rcu; 125 struct rcu_head rcu;