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: 3474801 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A74909F169 for ; Mon, 13 Jan 2014 11:47:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DCA6F20114 for ; Mon, 13 Jan 2014 11:47:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 01F7F2010E for ; Mon, 13 Jan 2014 11:47:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2FD910DCF9; Mon, 13 Jan 2014 03:47:09 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@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 Subject: [PATCH 2/2] drm/i915: Use drm_crtc_mask() helper 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: Daniel Vetter , intel-gfx@lists.freedesktop.org, Russell King X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-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; }