diff options
author | Tejun Heo <tj@kernel.org> | 2012-11-22 10:32:46 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-11-22 10:32:46 -0500 |
commit | 52bca930c913c85ed1157ebc8f9dd9bc38a8c2c3 (patch) | |
tree | a7912c69e930c657e762450d2993af791dc7929a | |
parent | 6d5759dd02af5307e71ca928be11005c08f8f967 (diff) |
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>
-rw-r--r-- | net/core/netprio_cgroup.c | 23 |
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) | |||
71 | { | 71 | { |
72 | size_t new_size = sizeof(struct netprio_map) + | 72 | size_t new_size = sizeof(struct netprio_map) + |
73 | ((sizeof(u32) * new_len)); | 73 | ((sizeof(u32) * new_len)); |
74 | struct netprio_map *new_priomap = kzalloc(new_size, GFP_KERNEL); | 74 | struct netprio_map *new = kzalloc(new_size, GFP_KERNEL); |
75 | struct netprio_map *old_priomap; | 75 | struct netprio_map *old; |
76 | 76 | ||
77 | old_priomap = rtnl_dereference(dev->priomap); | 77 | old = rtnl_dereference(dev->priomap); |
78 | 78 | ||
79 | if (!new_priomap) { | 79 | if (!new) { |
80 | pr_warn("Unable to alloc new priomap!\n"); | 80 | pr_warn("Unable to alloc new priomap!\n"); |
81 | return -ENOMEM; | 81 | return -ENOMEM; |
82 | } | 82 | } |
83 | 83 | ||
84 | if (old_priomap) | 84 | if (old) |
85 | memcpy(new_priomap->priomap, old_priomap->priomap, | 85 | memcpy(new->priomap, old->priomap, |
86 | old_priomap->priomap_len * | 86 | old->priomap_len * sizeof(old->priomap[0])); |
87 | sizeof(old_priomap->priomap[0])); | ||
88 | 87 | ||
89 | new_priomap->priomap_len = new_len; | 88 | new->priomap_len = new_len; |
90 | 89 | ||
91 | rcu_assign_pointer(dev->priomap, new_priomap); | 90 | rcu_assign_pointer(dev->priomap, new); |
92 | if (old_priomap) | 91 | if (old) |
93 | kfree_rcu(old_priomap, rcu); | 92 | kfree_rcu(old, rcu); |
94 | return 0; | 93 | return 0; |
95 | } | 94 | } |
96 | 95 | ||