summaryrefslogtreecommitdiffstats
path: root/net/core/netprio_cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-11-22 07:32:46 -0800
committerTejun Heo <tj@kernel.org>2012-11-22 07:32:46 -0800
commit52bca930c913c85ed1157ebc8f9dd9bc38a8c2c3 (patch)
treea7912c69e930c657e762450d2993af791dc7929a /net/core/netprio_cgroup.c
parent6d5759dd02af5307e71ca928be11005c08f8f967 (diff)
downloadlinux-52bca930c913c85ed1157ebc8f9dd9bc38a8c2c3.tar.gz
linux-52bca930c913c85ed1157ebc8f9dd9bc38a8c2c3.tar.bz2
linux-52bca930c913c85ed1157ebc8f9dd9bc38a8c2c3.zip
netprio_cgroup: shorten variable names in extend_netdev_table()
The function is about to go through a rewrite. In preparation, shorten the variable names so that we don't repeat "priomap" so often. This patch is cosmetic. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Neil Horman <nhorman@tuxdriver.com> Tested-and-Acked-by: Daniel Wagner <daniel.wagner@bmw-carit.de> Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/netprio_cgroup.c')
-rw-r--r--net/core/netprio_cgroup.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
index 66d98daf8aef..92cc54c81f0b 100644
--- a/net/core/netprio_cgroup.c
+++ b/net/core/netprio_cgroup.c
@@ -71,26 +71,25 @@ static int extend_netdev_table(struct net_device *dev, u32 new_len)
{
size_t new_size = sizeof(struct netprio_map) +
((sizeof(u32) * new_len));
- struct netprio_map *new_priomap = kzalloc(new_size, GFP_KERNEL);
- struct netprio_map *old_priomap;
+ struct netprio_map *new = kzalloc(new_size, GFP_KERNEL);
+ struct netprio_map *old;
- old_priomap = rtnl_dereference(dev->priomap);
+ old = rtnl_dereference(dev->priomap);
- if (!new_priomap) {
+ if (!new) {
pr_warn("Unable to alloc new priomap!\n");
return -ENOMEM;
}
- if (old_priomap)
- memcpy(new_priomap->priomap, old_priomap->priomap,
- old_priomap->priomap_len *
- sizeof(old_priomap->priomap[0]));
+ if (old)
+ memcpy(new->priomap, old->priomap,
+ old->priomap_len * sizeof(old->priomap[0]));
- new_priomap->priomap_len = new_len;
+ new->priomap_len = new_len;
- rcu_assign_pointer(dev->priomap, new_priomap);
- if (old_priomap)
- kfree_rcu(old_priomap, rcu);
+ rcu_assign_pointer(dev->priomap, new);
+ if (old)
+ kfree_rcu(old, rcu);
return 0;
}