From patchwork Mon Jan 13 11:46:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 3474791 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 18AE5C02DC for ; Mon, 13 Jan 2014 11:47:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F0A52010E for ; Mon, 13 Jan 2014 11:47:13 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 175CE2011E for ; Mon, 13 Jan 2014 11:47:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5071310DCEA; Mon, 13 Jan 2014 03:47:08 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-bk0-f46.google.com (mail-bk0-f46.google.com [209.85.214.46]) by gabe.freedesktop.org (Postfix) with ESMTP id E832510DCFB; Mon, 13 Jan 2014 03:47:00 -0800 (PST) Received: by mail-bk0-f46.google.com with SMTP id u15so2400051bkz.19 for ; Mon, 13 Jan 2014 03:46:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=t7ks3k5xoOvt4P7Vr72HaCPUoLqvrwELA9k1Y1zxS78=; b=F1K+Zmjom8n6ckymD6dT15IvzRrSUYmZ4KLCy9+20TguYsTKm+MTM2w722Pjiyx2nd BgH1J2z+Dn6hAOwo97ACksshPmb2YfYyZZDIM5wu+NvWhgUmYSUVA2f7V+/dIQnSgrze 6wYVH8UdqE3M+jnzv881zc4COFXpy1gGrnD2foAQULi9asNVKa62ix5WF9rTZvZlqwGo lqZ3UZmdxenx7WxtCoQsjUxEzQp38p1gOAwkOZRe+TrI5T9jJTPvWTf5t7kT3WXOM9z4 q0ArAaFWU28ZUYXltKmJrts0Q1sRO1929+OUxwHQdl8o+prb0r6n/11a79l90O1rZ9ja Syww== X-Received: by 10.204.203.12 with SMTP id fg12mr8941428bkb.31.1389613617706; Mon, 13 Jan 2014 03:46:57 -0800 (PST) Received: from localhost (port-52867.pppoe.wtnet.de. [46.59.207.43]) by mx.google.com with ESMTPSA id dg4sm15568686bkc.10.2014.01.13.03.46.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jan 2014 03:46:57 -0800 (PST) From: Thierry Reding To: dri-devel@lists.freedesktop.org Date: Mon, 13 Jan 2014 12:46:50 +0100 Message-Id: <1389613610-21084-3-git-send-email-treding@nvidia.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1389613610-21084-1-git-send-email-treding@nvidia.com> References: <1389613610-21084-1-git-send-email-treding@nvidia.com> Cc: David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, David Herrmann , Russell King Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Use drm_crtc_mask() helper X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, 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 Replace an open-coded occurrence by a call to the new drm_crtc_mask() helper. Signed-off-by: Thierry Reding --- drivers/gpu/drm/i915/intel_display.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e77d4b8856a7..807feab38ea6 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -8723,21 +8723,7 @@ static struct drm_crtc_helper_funcs intel_helper_funcs = { static bool intel_encoder_crtc_ok(struct drm_encoder *encoder, struct drm_crtc *crtc) { - struct drm_device *dev; - struct drm_crtc *tmp; - int crtc_mask = 1; - - WARN(!crtc, "checking null crtc?\n"); - - dev = crtc->dev; - - list_for_each_entry(tmp, &dev->mode_config.crtc_list, head) { - if (tmp == crtc) - break; - crtc_mask <<= 1; - } - - if (encoder->possible_crtcs & crtc_mask) + if (encoder->possible_crtcs & drm_crtc_mask(crtc)) return true; return false; }