From patchwork Wed Jan 13 14:48:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 8026321 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1B55EBEEE5 for ; Wed, 13 Jan 2016 15:04:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2DEB72051C for ; Wed, 13 Jan 2016 15:04:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id BC58C20515 for ; Wed, 13 Jan 2016 15:04:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BEDC46E935; Wed, 13 Jan 2016 07:04:44 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org X-Greylist: delayed 909 seconds by postgrey-1.34 at gabe; Wed, 13 Jan 2016 07:04:42 PST Received: from m50-134.163.com (m50-134.163.com [123.125.50.134]) by gabe.freedesktop.org (Postfix) with ESMTP id 1076F6E7BB for ; Wed, 13 Jan 2016 07:04:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=Y/F/Gu4VWNcsSA3bGI XdBCkBIWWMROr+m5zQEu3uRx4=; b=cDjeaL7z2j8KrpEGhdIUoaMSLr+OkIp720 /gc4HGRiAGKIjykYx0SoToSXJRY8cvhocgGl/Poh5r0nHhaKrR8drFVTK22jS2Aa ydDVhscT/fh43dEzh65x6xMVKyMXgi8NzxYdiu2LmvYkO6OgKdBTnFYFNzwnZB2i bMqsD+Coo= Received: from localhost (unknown [116.77.137.250]) by smtp4 (Coremail) with SMTP id DtGowEDprPDQY5ZWJkwKAA--.911S3; Wed, 13 Jan 2016 22:48:50 +0800 (CST) From: Geliang Tang To: Daniel Vetter , Jani Nikula , David Airlie Date: Wed, 13 Jan 2016 22:48:39 +0800 Message-Id: <60dcf3fb69ec74bd57026ae434bd06514d699044.1452696179.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 X-CM-TRANSID: DtGowEDprPDQY5ZWJkwKAA--.911S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gr1fZw1UAr4DGr4fZr4kXrb_yoWDZFg_ur Z7ZrnrGw4ktrsY9FW7Cr9xZFyIyFnYqrnYgw1IvayIyr17CanxZrZIqry7ZrWxWF4ftF18 Ww1kWFZxGrnrGjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUk9N3UUUUU== X-Originating-IP: [116.77.137.250] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiMBPumVWBTt-3MQAAsX Cc: Geliang Tang , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 1/5] drm/i915: use hlist_for_each_entry X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use hlist_for_each_entry() instead of hlist_for_each() to simplify the code. Signed-off-by: Geliang Tang --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 5d01ea6..8f194be 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -192,14 +192,10 @@ static struct i915_vma *eb_get_vma(struct eb_vmas *eb, unsigned long handle) return NULL; return eb->lut[handle]; } else { - struct hlist_head *head; - struct hlist_node *node; - - head = &eb->buckets[handle & eb->and]; - hlist_for_each(node, head) { - struct i915_vma *vma; + struct i915_vma *vma; - vma = hlist_entry(node, struct i915_vma, exec_node); + hlist_for_each_entry(vma, &eb->buckets[handle & eb->and], + exec_node) { if (vma->exec_handle == handle) return vma; }