From patchwork Fri Dec 16 19:25:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9478433 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 E2DFB601C2 for ; Fri, 16 Dec 2016 19:31:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5DEA28772 for ; Fri, 16 Dec 2016 19:31:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB18B287DB; Fri, 16 Dec 2016 19:31:32 +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=unavailable 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 97F1F28772 for ; Fri, 16 Dec 2016 19:31:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A51096ED02; Fri, 16 Dec 2016 19:31:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wj0-x242.google.com (mail-wj0-x242.google.com [IPv6:2a00:1450:400c:c01::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 553136ECDB; Fri, 16 Dec 2016 19:26:22 +0000 (UTC) Received: by mail-wj0-x242.google.com with SMTP id xy5so15613396wjc.1; Fri, 16 Dec 2016 11:26:22 -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=oFOraxxIrdRhXGv8jpRU8DkaN2PdSd1/pZaohLU98N4R/qtfTkMwEs2MUpjFIYVvuC pp8iUHzfygDLgIUBgWc1fFJOZqfNhER6REW5Rh3O6fhjh/8n5R8YO2PpegvBFAXLzVgA ZeJQFIS1Ch1VkJb17aSKPXn+6yDDFvy6iBsXn9b0c0aZ49hEXRZ/ByAzOLhxOO4cE/sr PacW/NQztIkQAWy5HYxu7qubjVau/iH9YWQ1RnVh8hPmuPR0vEB/gBvaABfkBdmV+vse oDMj/xmVmTwllinQJ793NTSf3rHVpoUOcCeadhpW4vDMaww2XPxSpI03wHftxCtWiRBb qrTA== 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=DrEeie0i+bz73pCqzVO1izYjXKReu2orwO1GqGtQREpSCtNgC1/QuK0xwE/o8htNAU T/+S6H7VNpOQifWJBaYtWwwiQ3E263xD/oYkSkyRqAh+YvAra64MctEHm0g4wVWtRYi6 38Nz4xY44ePOVcJwJWGXdUv+E+TBCw/+SE2uxnI9VIoiarS7PQ7HXJz1gyfnuw33JrB8 bRHblma5LRWXBdY0EKrk8711vF/pyssWiHiB7bC/UK7FkUU2ixQHUWJ1XwWg8NeaDVj3 FHJbQptd4PoV4feUihFbv34+KIl4SixRxFfFweQYjaNu/ObVpkpz3BFH0PwtnhafI8lE 1TQQ== X-Gm-Message-State: AIkVDXIYQUVLb1PGEIXJDNXLy2Hj9yH97AlSfvfWwW9Xgn0mu34fdplgXTQE5Xs34SJonA== X-Received: by 10.194.56.234 with SMTP id d10mr4525665wjq.78.1481916379979; Fri, 16 Dec 2016 11:26:19 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id v2sm8125856wja.41.2016.12.16.11.26.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Dec 2016 11:26:19 -0800 (PST) From: Chris Wilson To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 27/38] drm: Rename prev_node to hole in drm_mm_scan_add_block() Date: Fri, 16 Dec 2016 19:25:39 +0000 Message-Id: <20161216192550.8352-28-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161216192550.8352-1-chris@chris-wilson.co.uk> References: <20161216192550.8352-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)) {