Skip to contentSkip to conversation

Thresholds in fib_trie.c are used as consts, so make them const.

PATCH Applied Denis V. Lunev 2 participants 2 messages Dec 13, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Thresholds in fib_trie.c are used as consts, so make them const.

[IPV4] Thresholds in fib_trie.c are used as consts, so make them const.

There are several thresholds for trie fib hash management. They are used in the code as a constants. Make them constants from the compiler point of view.

---

net/ipv4/fib_trie.c +4 -4
@@ -299,10 +299,10 @@ static inline void check_tnode(const struct tnode *tn)
 	WARN_ON(tn && tn->pos+tn->bits > 32);
 }
 
-static int halve_threshold = 25;
-static int inflate_threshold = 50;
-static int halve_threshold_root = 8;
-static int inflate_threshold_root = 15;
+static const int halve_threshold = 25;
+static const int inflate_threshold = 50;
+static const int halve_threshold_root = 8;
+static const int inflate_threshold_root = 15;
 
 
 static void __alias_free_mem(struct rcu_head *head)
maintainer Applied
#1 lore raw

From: "Denis V. Lunev" <[email protected]>
Date: Thu, 13 Dec 2007 11:06:18 +0300

Quoted 7 lines

[IPV4] Thresholds in fib_trie.c are used as consts, so make them const.

There are several thresholds for trie fib hash management. They are used in the code as a constants. Make them constants from the compiler point of view.

Applied, thanks for fixing this patch up.