From patchwork Wed Oct 5 12:33:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 9362835 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 9EA326075E for ; Wed, 5 Oct 2016 12:34:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 907772893E for ; Wed, 5 Oct 2016 12:34:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84BBF28946; Wed, 5 Oct 2016 12:34:13 +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 52A292893E for ; Wed, 5 Oct 2016 12:34:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 031FD6E834; Wed, 5 Oct 2016 12:34:09 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A0FE6E830 for ; Wed, 5 Oct 2016 12:34:08 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id f193so19744806wmg.2 for ; Wed, 05 Oct 2016 05:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c+A8b1TdkWvAz5MYKOVeiZn2/IUTU4i0OzXWT9PhTfs=; b=f2/kV9JHrpIY2Bg1gk4X3QjEdiqAzNONBSAXc3KGKh2/9RExGlewYrEvm1fgz5ZGN6 DnCBeKjEcyuHJShCg2zsF9IB1fhAVR+HN/Sksw/eyVKQ5WCb0P2RGOiWl/NGcMRAn554 2vttobnxddv66XJGyMRZQjh59MyJ0El5n7suOFRU4dc2j/+KHCMYw6hHScX9L6nnvdgx AzrxbL4O/sako6GObFBBNxzzSMD/OFe2wPH00yl1VWbOpRUdMw1B14819n6cdW4cTjvp 4YI7DFkvny8ND3w6bgo0s+vbBOMTwxbuAEOOTwutkTpPRcUai3HmQCtMIfhht+0LPxwG Ljmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c+A8b1TdkWvAz5MYKOVeiZn2/IUTU4i0OzXWT9PhTfs=; b=a0XSXJ6qW5K0zZIiGyD4arvpJQ+XnEaA6+/oaNOksZjtYUzN40CS7nFu7w7uSwBQ61 /xIvikN6uQ9d5G2jZslch82fyBb3vlMcut7LILXRG3sVGGT/4oh9uMOu5XZHkAy8xsb8 I1lpvVfWAmgQzcNOgpkA0gIT03EWPYu240liS9mWAAjcMwfwubhFBapTI54e6DtoA5IR TIuFBa1P/luuZVPUnb5DZLHG2Xa4eU5v8ryvuX97StTrMnPSGqq/fN3rk5IsJdbuWBMY T4lcgKb5fynf6zHSDdqRkUPmfve/03C1MZ0iAdgVqSb74/ZyIr4XUKqpdzWQVsmDHgoa hpFw== X-Gm-Message-State: AA6/9RkTOF86iA+rnZSCPUul+Vckv8TQxbm10tNWzlk1mtVLNcsfzGV66LPeZ1HcRy1VvA== X-Received: by 10.194.134.161 with SMTP id pl1mr7484346wjb.81.1475670846596; Wed, 05 Oct 2016 05:34:06 -0700 (PDT) Received: from e31.Home ([2a02:c7d:9b6d:e300:916a:6cab:ac67:71c2]) by smtp.gmail.com with ESMTPSA id t138sm29428317wmt.5.2016.10.05.05.34.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Oct 2016 05:34:06 -0700 (PDT) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Wed, 5 Oct 2016 13:33:35 +0100 Message-Id: <1475670829-14025-9-git-send-email-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475670829-14025-1-git-send-email-tvrtko.ursulin@linux.intel.com> References: <1475670829-14025-1-git-send-email-tvrtko.ursulin@linux.intel.com> Subject: [Intel-gfx] [PATCH 08/22] drm/i915: Do not use INTEL_INFO(dev_priv)->ring_mask inside WARNs 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-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin Saves 1520 bytes of .rodata strings. Signed-off-by: Tvrtko Ursulin Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/intel_engine_cs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c index d00ec805f93d..9f3d6af9bbea 100644 --- a/drivers/gpu/drm/i915/intel_engine_cs.c +++ b/drivers/gpu/drm/i915/intel_engine_cs.c @@ -110,13 +110,14 @@ int intel_engines_init(struct drm_device *dev) { struct drm_i915_private *dev_priv = to_i915(dev); struct intel_device_info *device_info = mkwrite_device_info(dev_priv); + unsigned int ring_mask = INTEL_INFO(dev_priv)->ring_mask; unsigned int mask = 0; int (*init)(struct intel_engine_cs *engine); unsigned int i; int ret; - WARN_ON(INTEL_INFO(dev_priv)->ring_mask == 0); - WARN_ON(INTEL_INFO(dev_priv)->ring_mask & + WARN_ON(ring_mask == 0); + WARN_ON(ring_mask & GENMASK(sizeof(mask) * BITS_PER_BYTE - 1, I915_NUM_ENGINES)); for (i = 0; i < ARRAY_SIZE(intel_engines); i++) { @@ -143,7 +144,7 @@ int intel_engines_init(struct drm_device *dev) * are added to the driver by a warning and disabling the forgotten * engines. */ - if (WARN_ON(mask != INTEL_INFO(dev_priv)->ring_mask)) + if (WARN_ON(mask != ring_mask)) device_info->ring_mask = mask; device_info->num_rings = hweight32(mask);