Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5295191rwr; Mon, 8 May 2023 22:29:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ouzhfQzqUafzh195qlYk2LJE2WIC84VhvNYL6PjJoFubvJrWTZKoStwSVD5KwmpLpMZbq X-Received: by 2002:a17:90b:4c06:b0:246:5f9e:e4cf with SMTP id na6-20020a17090b4c0600b002465f9ee4cfmr13137768pjb.43.1683610150533; Mon, 08 May 2023 22:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683610150; cv=none; d=google.com; s=arc-20160816; b=Cc9Yc4EYioqfsmm2KSluFogyAyMsyPPIjCXSF4DJ5BwfTL1XBYtVXlHTj9dzWWT03j krKlkNqK3O+0YUKkVWgvtSuy+MS3mVGJ6fmYfeY6Y8NKho9N5warHzrLKtSHwmZMo6xR plv06msnX1eed0mqxgqyhGb06VDdu6n2HCCVV7pP1l8sm4DN8SXlq30BsUKj4SywNaeI I51bTHr6heZn0P/zr2TJoQaEfJSa0W33NkTjuPBIYnVqWWogq/nblFTySR/ycCDrHpoN klikIDyDY/WrA1Qo9p9UFx/f74Y2CjlD74x0pqjGvmAHwRxiO0HL3d7IVG9hkfJXZAN9 daHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=x5358EEFXNCj4dUpYdEEeloasX/DsAzZwfupueLhZbw=; b=xmdfJaWfcdoyJnlNxKtxi1XTtSlOEied44aW0iAcc8ItJ9KmjVOLxN9b9Zo2qtxJis knyeHRpq8CafwIURbzL6wgTJg559JhUYfMaQqONYWeVvEx4Mcvz5HRhCW9CrIaTBDEUl k00PpZ5de5XIbYSke46/AvLWJ3G13qVsASvcX2n1Dzjv7XEFSApcb7nHr28mPiAB66/T wPHWQa8fJChVhQ/7P9PvqgMHvgSDrHERSBYRv9+5mTMfTkZ8is9sy5pxx1UsPzPFSku2 sqp+aFc1UCJIb5jutOAJopvw3sSGXzGnaEnVNe29fw476xBRJX8PeYDazeKZHHgJtTqe yvhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EJ0ErFeE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e5-20020a63aa05000000b00528595a1390si754159pgf.588.2023.05.08.22.28.56; Mon, 08 May 2023 22:29:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EJ0ErFeE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234584AbjEIFO6 (ORCPT + 99 others); Tue, 9 May 2023 01:14:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234528AbjEIFOw (ORCPT ); Tue, 9 May 2023 01:14:52 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 586D99028 for ; Mon, 8 May 2023 22:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683609291; x=1715145291; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/zV+bBMFzqzEbY+zzFUi37/thW9CxZ9azFDevSUQdV0=; b=EJ0ErFeEMyLQqq7fhYPEDJ3JavD+UZ6nsYN0jo+wFtG/8j9vC3B4qCKO q5eDVBBu88+Jn7ei73QVeKL0UglOiHpHGEFoUa974ZbJS5fO/EdV9nAgW 280en2mHw28wbh+QE5u/23rPriVgzNbyd9UA8ZV1VUhBYJrFR+EG8FcMO i6SdvdGPFADoE6YEQu9W2MvfPYPmmLjvuAKzdyOMfdCX+kqkFN0A2gz2h mvVYNCDhydf6CT+21fdBcPsddhaSuDunot18XTHOH9eIQ7LFcZBO2R9WI 5Y5QHRshjhU9vmvjMEdYyyOveH+wMY6As8YuqyuB+bWkmPCnIJhMSkXlv A==; X-IronPort-AV: E=McAfee;i="6600,9927,10704"; a="339037116" X-IronPort-AV: E=Sophos;i="5.99,261,1677571200"; d="scan'208";a="339037116" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2023 22:14:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10704"; a="873033256" X-IronPort-AV: E=Sophos;i="5.99,261,1677571200"; d="scan'208";a="873033256" Received: from lucas-s2600cw.jf.intel.com ([10.165.21.196]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2023 22:14:45 -0700 From: Lucas De Marchi To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: Andy Shevchenko , Thomas Gleixner , linux-kernel@vger.kernel.org, Masahiro Yamada , Andrew Morton , Kevin Brodsky , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , Jani Nikula , Lucas De Marchi Subject: [PATCH 3/3] drm/i915: Temporary conversion to new GENMASK/BIT macros Date: Mon, 8 May 2023 22:14:03 -0700 Message-Id: <20230509051403.2748545-4-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230509051403.2748545-1-lucas.demarchi@intel.com> References: <20230509051403.2748545-1-lucas.demarchi@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the REG_* macros from i915_reg_defs.h to use the new macros defined in linux/bits.h. This is just to help on the implementation of the new macros and not intended to be applied. Signed-off-by: Lucas De Marchi --- drivers/gpu/drm/i915/i915_reg_defs.h | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_reg_defs.h b/drivers/gpu/drm/i915/i915_reg_defs.h index 622d603080f9..61fbb8d62b25 100644 --- a/drivers/gpu/drm/i915/i915_reg_defs.h +++ b/drivers/gpu/drm/i915/i915_reg_defs.h @@ -17,10 +17,7 @@ * * @return: Value with bit @__n set. */ -#define REG_BIT(__n) \ - ((u32)(BIT(__n) + \ - BUILD_BUG_ON_ZERO(__is_constexpr(__n) && \ - ((__n) < 0 || (__n) > 31)))) +#define REG_BIT(__n) BIT_U32(__n) /** * REG_BIT8() - Prepare a u8 bit value @@ -30,10 +27,7 @@ * * @return: Value with bit @__n set. */ -#define REG_BIT8(__n) \ - ((u8)(BIT(__n) + \ - BUILD_BUG_ON_ZERO(__is_constexpr(__n) && \ - ((__n) < 0 || (__n) > 7)))) +#define REG_BIT8(__n) BIT_U8(__n) /** * REG_GENMASK() - Prepare a continuous u32 bitmask @@ -44,11 +38,7 @@ * * @return: Continuous bitmask from @__high to @__low, inclusive. */ -#define REG_GENMASK(__high, __low) \ - ((u32)(GENMASK(__high, __low) + \ - BUILD_BUG_ON_ZERO(__is_constexpr(__high) && \ - __is_constexpr(__low) && \ - ((__low) < 0 || (__high) > 31 || (__low) > (__high))))) +#define REG_GENMASK(__high, __low) GENMASK_U32(__high, __low) /** * REG_GENMASK64() - Prepare a continuous u64 bitmask @@ -59,11 +49,7 @@ * * @return: Continuous bitmask from @__high to @__low, inclusive. */ -#define REG_GENMASK64(__high, __low) \ - ((u64)(GENMASK_ULL(__high, __low) + \ - BUILD_BUG_ON_ZERO(__is_constexpr(__high) && \ - __is_constexpr(__low) && \ - ((__low) < 0 || (__high) > 63 || (__low) > (__high))))) +#define REG_GENMASK64(__high, __low) GENMASK_ULL(__high, __low) /** * REG_GENMASK8() - Prepare a continuous u8 bitmask @@ -74,11 +60,7 @@ * * @return: Continuous bitmask from @__high to @__low, inclusive. */ -#define REG_GENMASK8(__high, __low) \ - ((u8)(GENMASK(__high, __low) + \ - BUILD_BUG_ON_ZERO(__is_constexpr(__high) && \ - __is_constexpr(__low) && \ - ((__low) < 0 || (__high) > 7 || (__low) > (__high))))) +#define REG_GENMASK8(__high, __low) GENMASK_U8(__high, __low) /* * Local integer constant expression version of is_power_of_2(). -- 2.40.1