From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: [PATCH 3/7] netprio_cgroup: shorten variable names in extend_netdev_table() Date: Mon, 19 Nov 2012 23:06:26 -0800 Message-ID: <1353395190-4530-4-git-send-email-tj@kernel.org> References: <1353395190-4530-1-git-send-email-tj@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=sxJE6ulWl83GREpglOjecgmrZKtxrG3QdFhzFownVEM=; b=sz2Ua3rUupv/iKAoiTpSfu1A1nrUChEKb7g+2uux1zSm1mJP/no4pifo5yMbpbBSsm eJ2m1SsLSCYj3A0NXwdyubhZU2pJizDlEcWfk40rYBZM8M0vYgakCnNXbRswBI+/jNX4 L+0spS0zC7c7b01SBEhId0hsL/zO/XlUWu3l9Ae1x1sFckgGNtjl2kKALH+g9QIa3b/9 HqJ27wMJ8HNg6qfLyv7+z53Smx1R1Jjn7kL8TIqojTAC0Cl+RvCYUm9buRfbO1CTBYAG mqbmATv++Ubvy4TG0BZrLQdjdGfnlu8Y/LD2dJi6qGGFIT8eX4YT0+7r44WwEFPimKm5 UTlw== In-Reply-To: <1353395190-4530-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: daniel.wagner-98C5kh4wR6ohFhg+JK9F0w@public.gmane.org, serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org, ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org, nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org, tgraf-G/eBtMaohhA@public.gmane.org Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Tejun Heo , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org 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 Acked-by: Neil Horman --- net/core/netprio_cgroup.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c index 66d98da..92cc54c 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; } -- 1.7.11.7