aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorStephen Hemmigner <shemminger@osdl.org>2005-08-09 23:25:39 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2005-08-29 18:54:08 -0400
commitbb435b8d816582064ee0ddb1e2a6fbca67f34108 (patch)
tree48fb873d1f030a49747cc574636e80a3a9e99ac2 /net/ipv4
parent2f80b3c8262d0d646812f776db024d88d569a0c1 (diff)
[IPV4]: fib_trie: Use const
Use const where possible and get rid of EXTRACT() macro that was never used. Signed-off-by: Stephen Hemmigner <shemminger@osdl.org> Signed-off-by: Robert Olsson <robert.olsson@its.uu.se> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/fib_trie.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 914a4c2aae42..395f64df6f9a 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -77,7 +77,6 @@
77#undef CONFIG_IP_FIB_TRIE_STATS 77#undef CONFIG_IP_FIB_TRIE_STATS
78#define MAX_CHILDS 16384 78#define MAX_CHILDS 16384
79 79
80#define EXTRACT(p, n, str) ((str)<<(p)>>(32-(n)))
81#define KEYLENGTH (8*sizeof(t_key)) 80#define KEYLENGTH (8*sizeof(t_key))
82#define MASK_PFX(k, l) (((l)==0)?0:(k >> (KEYLENGTH-l)) << (KEYLENGTH-l)) 81#define MASK_PFX(k, l) (((l)==0)?0:(k >> (KEYLENGTH-l)) << (KEYLENGTH-l))
83#define TKEY_GET_MASK(offset, bits) (((bits)==0)?0:((t_key)(-1) << (KEYLENGTH - bits) >> offset)) 82#define TKEY_GET_MASK(offset, bits) (((bits)==0)?0:((t_key)(-1) << (KEYLENGTH - bits) >> offset))
@@ -162,10 +161,8 @@ static int trie_debug = 0;
162 161
163#define DBG(x...) do { if (trie_debug) printk(x); } while (0) 162#define DBG(x...) do { if (trie_debug) printk(x); } while (0)
164 163
165static int tnode_full(struct tnode *tn, struct node *n);
166static void put_child(struct trie *t, struct tnode *tn, int i, struct node *n); 164static void put_child(struct trie *t, struct tnode *tn, int i, struct node *n);
167static void tnode_put_child_reorg(struct tnode *tn, int i, struct node *n, int wasfull); 165static void tnode_put_child_reorg(struct tnode *tn, int i, struct node *n, int wasfull);
168static int tnode_child_length(struct tnode *tn);
169static struct node *resize(struct trie *t, struct tnode *tn); 166static struct node *resize(struct trie *t, struct tnode *tn);
170static struct tnode *inflate(struct trie *t, struct tnode *tn); 167static struct tnode *inflate(struct trie *t, struct tnode *tn);
171static struct tnode *halve(struct trie *t, struct tnode *tn); 168static struct tnode *halve(struct trie *t, struct tnode *tn);
@@ -188,7 +185,7 @@ static inline struct node *tnode_get_child(struct tnode *tn, int i)
188 return tn->child[i]; 185 return tn->child[i];
189} 186}
190 187
191static inline int tnode_child_length(struct tnode *tn) 188static inline int tnode_child_length(const struct tnode *tn)
192{ 189{
193 return 1 << tn->bits; 190 return 1 << tn->bits;
194} 191}
@@ -400,7 +397,7 @@ static void tnode_free(struct tnode *tn)
400 * and no bits are skipped. See discussion in dyntree paper p. 6 397 * and no bits are skipped. See discussion in dyntree paper p. 6
401 */ 398 */
402 399
403static inline int tnode_full(struct tnode *tn, struct node *n) 400static inline int tnode_full(const struct tnode *tn, const struct node *n)
404{ 401{
405 if (n == NULL || IS_LEAF(n)) 402 if (n == NULL || IS_LEAF(n))
406 return 0; 403 return 0;