OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 2.6.25] [IPV4] Thresholds in fib_trie.c are used as consts, so make them const.
[PATCH 2.6.25] [IPV4] Thresholds in fib_trie.c are used as consts, so make them const. [message #25026] Thu, 13 December 2007 08:06 Go to next message
den is currently offline  den
Messages: 494
Registered: December 2005
Senior Member
[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.

Signed-off-by: Denis V. Lunev <den@openvz.org>
---
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -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)
Re: [PATCH 2.6.25] [IPV4] Thresholds in fib_trie.c are used as consts, so make them const. [message #25055 is a reply to message #25026] Thu, 13 December 2007 17:48 Go to previous message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: "Denis V. Lunev" <den@openvz.org>
Date: Thu, 13 Dec 2007 11:06:18 +0300

> [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.
> 
> Signed-off-by: Denis V. Lunev <den@openvz.org>

Applied, thanks for fixing this patch up.
Previous Topic: [PATCH 2.6.25] [IPV6] Always pass a valid nl_info to inet6_rt_notify.
Next Topic: [PATCH] Mark timer_stats as incompatible with multiple pid namespaces
Goto Forum:
  


Current Time: Wed Jul 30 07:53:41 GMT 2025

Total time taken to generate the page: 0.04875 seconds