Skip to contentSkip to conversation

ipv4: Cleanup struct net dereference in rt_intern_hash

PATCH Applied Pavel Emelyanov 2 participants 2 messages Mar 24, 2010 – Mar 27, 2010

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

PATCH 1/2 ipv4: Cleanup struct net dereference in rt_intern_hash

There's no need in getting it 3 times and gcc isn't smart enough to understand this himself.

This is just a cleanup before the fix (next patch).

---
 net/ipv4/route.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/ipv4/route.c +2 -2
index 32d3961..28c1c2f 100644
@@ -1212,11 +1212,11 @@ restart:
 		    slow_chain_length(rt_hash_table[hash].chain) > rt_chain_length_max) {
 			struct net *net = dev_net(rt->u.dst.dev);
 			int num = ++net->ipv4.current_rt_cache_rebuild_count;
-			if (!rt_caching(dev_net(rt->u.dst.dev))) {
+			if (!rt_caching(net)) {
 				printk(KERN_WARNING "%s: %d rebuilds is over limit, route caching disabled\n",
 					rt->u.dst.dev->name, num);
 			}
-			rt_emergency_hash_rebuild(dev_net(rt->u.dst.dev));
+			rt_emergency_hash_rebuild(net);
 		}
 	}