From patchwork Thu Dec 22 08:36:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9484423 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AB88B601D2 for ; Thu, 22 Dec 2016 08:38:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A84BA277D9 for ; Thu, 22 Dec 2016 08:38:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BAA328285; Thu, 22 Dec 2016 08:38:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 608E9277D9 for ; Thu, 22 Dec 2016 08:38:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BAEB66F175; Thu, 22 Dec 2016 08:38:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wj0-x241.google.com (mail-wj0-x241.google.com [IPv6:2a00:1450:400c:c01::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5F7BD6F174; Thu, 22 Dec 2016 08:37:15 +0000 (UTC) Received: by mail-wj0-x241.google.com with SMTP id j10so35201241wjb.3; Thu, 22 Dec 2016 00:37:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lxGSe9WiELiJ4icnZQ3H120GNIYGp6Vv17hOShoMRF0=; b=awjZnkoHfB/sckp0pidB9z0YeTl6XxNPzKSOeyCytUMaLOSZsTTHjvFGBppq5FGEzs Gi5dUhIqXkI9tmzUHBl2FZlar85YzZedZE53YjWmyP7inyKfDUxKhVdhLx0n4ewkbbtm o9MTL6iKaJY0vgaI7tf9+0FlmMxhKBZlFaHg0v/9wfAMifvdFuuzE/gZikQnM1GD/y1g PeaeBywn1CvMHRe3vTxuvQnZBkA6cWvCqkOG2KRJIpXgC4bbSXrJMWJKmWUKZ113t+QO VFt+lLvZPgumxWDAWnBUexVI87H3SkkuFLkZSgbGZ1mG/6R1s2DQvTIc+jhlKoTEaU3v igQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=lxGSe9WiELiJ4icnZQ3H120GNIYGp6Vv17hOShoMRF0=; b=uDYlKOXfYYT9vEzrpXxCtMzbvsUwEKaHG6dMaPNh2isGljf0xDvqFjzQtlnx5jbSgB dQK4PW92/bn5Iixbo7alPDDTY+b1+yAXNuzDDnzra6AfjNEWGocyvhES7QbUnw/sCDUL AfmtThxJbrI2OlDtn+Mry9Q5EObxVwzQr9WRppMITVgOQDIgorXV1f52pqcx0n4YAlgg c98jB++09ecCsKcApgy5omqTislETnd5Fpd1vkG6uU1YZge69fUlETB01P6PEQwaRmMJ N7coH49F8vTNmwdc8CHWiWcjZpgivZvYiM0nZ0eYRsCmXXEZm+9/45yBij7+W8ZAtz1G Hmug== X-Gm-Message-State: AIkVDXJ8T4KlJV4ZiluNrs/Ed8TJncpCtmrvbeng65be/+s8PPdR4aHh8f+2HoQqNapA5Q== X-Received: by 10.194.53.227 with SMTP id e3mr7728522wjp.225.1482395833681; Thu, 22 Dec 2016 00:37:13 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id di9sm34442318wjc.37.2016.12.22.00.37.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Dec 2016 00:37:12 -0800 (PST) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH v4 27/38] drm: Rename prev_node to hole in drm_mm_scan_add_block() Date: Thu, 22 Dec 2016 08:36:30 +0000 Message-Id: <20161222083641.2691-28-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161222083641.2691-1-chris@chris-wilson.co.uk> References: <20161222083641.2691-1-chris@chris-wilson.co.uk> Cc: intel-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Acknowledging that we were building up the hole was more useful to me when reading the code, than knowing the relationship between this node and the previous node. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/drm_mm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 21bd2e13738b..459f10ca5714 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -811,7 +811,7 @@ bool drm_mm_scan_add_block(struct drm_mm_scan *scan, struct drm_mm_node *node) { struct drm_mm *mm = scan->mm; - struct drm_mm_node *prev_node; + struct drm_mm_node *hole; u64 hole_start, hole_end; u64 adj_start, adj_end; @@ -821,17 +821,17 @@ bool drm_mm_scan_add_block(struct drm_mm_scan *scan, node->scanned_block = 1; mm->scan_active++; - prev_node = list_prev_entry(node, node_list); + hole = list_prev_entry(node, node_list); - node->scanned_preceeds_hole = prev_node->hole_follows; - prev_node->hole_follows = 1; + node->scanned_preceeds_hole = hole->hole_follows; + hole->hole_follows = 1; list_del(&node->node_list); - node->node_list.prev = &prev_node->node_list; + node->node_list.prev = &hole->node_list; node->node_list.next = &scan->prev_scanned_node->node_list; scan->prev_scanned_node = node; - adj_start = hole_start = drm_mm_hole_node_start(prev_node); - adj_end = hole_end = drm_mm_hole_node_end(prev_node); + adj_start = hole_start = drm_mm_hole_node_start(hole); + adj_end = hole_end = drm_mm_hole_node_end(hole); if (scan->check_range) { if (adj_start < scan->range_start) @@ -841,7 +841,7 @@ bool drm_mm_scan_add_block(struct drm_mm_scan *scan, } if (mm->color_adjust) - mm->color_adjust(prev_node, scan->color, &adj_start, &adj_end); + mm->color_adjust(hole, scan->color, &adj_start, &adj_end); if (check_free_hole(adj_start, adj_end, scan->size, scan->alignment)) {