From patchwork Thu Feb 8 07:45:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 20088 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp6557dyd; Wed, 7 Feb 2024 23:45:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVJWuSF2hLMQJ2qFzWiW0tTJhdvjZ4iuOJ8QvUr3+ky5OoX5t7d/vjzOMAWBPIgYsdSxjCx88fiMdVKJsQcVWhW4751wg== X-Google-Smtp-Source: AGHT+IE9/F9ViqULBG1f9WbXJLmTj5cwxgr5VKDLFuI+n8mua9Liyv2AxQjWda/W8BAcB9ZLrSz7 X-Received: by 2002:a17:907:7850:b0:a38:3461:d840 with SMTP id lb16-20020a170907785000b00a383461d840mr5625971ejc.42.1707378339511; Wed, 07 Feb 2024 23:45:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707378339; cv=pass; d=google.com; s=arc-20160816; b=XvzmN6A0mu6ZnHIGAmQgmpMPRPA5vlVmi9JRFAz+3QU5Ha56wMfhnZBflq5vd+sd7u JqeslY408gcuIQLnAyqIQXAxJgkVRauJJR9sDIjsfrLIwYbj569z6UPWgpGHWYMgGsTg 5/6E1x52xPMjdp8yX12jiCbPPHQZzSdU15HM5DPZJ2qZSh8W52yf/zkRFrLCgfx2qXiW G2oWO1T+2otKg9OzOtIky+HiHA+aZFWMsuEaThKNAg7nErXx/lF4E18VW4Ri/QSjUSex 1842XJPdIZVgLJ89CFnKVImCEpv0LjgheMNzD6xFdscq5UhqxzMOeENqwYYS3gn6wDGh NjxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=KVw22PdfDKFil//af2QgXxgoe2+8GQo16n64wcJsaXo=; fh=5Qme0LKJ8jcw90/2xaExqXieU5x5hsXtWWzK1bnXtHg=; b=hV1ry0ix9oGtzQZCyw1D+HN761SIEtgbKBt03w0f36ElNmsgvtkQtIGYX3b/ckjfMa fQ9EwOEcBqf8qLBtxusU/qA+JjgGBi3LhW5VbYkzzAaWiYl1baCzHiWwUNHm33ciQUxN OUk7Tm5hsb93bg4Q10TXa3pD5Bvb03kbNT79QlxytU4z71ii6tBcgsq2BkvsWEGsprBJ qERXhFjz0K1uhvBfNPchNnLkQnRphfvgUReoGc41INYijJCaRTDBLEKEQn4O776CaHEO be/WbwilwfyhOmQIGGJ3WOQ0hBYUxxB8KAP8KtRGDlCNYPrRCxTD/OU+hcyPqOIasIfo T1Ug==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fsLMUKHo; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57567-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57567-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCVnfC+vtdI9/K+/QQK0sv57K9PUQ1O9P+x8H4K+v8x6B++5iVPcZAu/42RDDACtRauzTuznRArfDcUdexgv6yB/dUhQEA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id z27-20020a170906075b00b00a3724c1d792si1907700ejb.390.2024.02.07.23.45.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 23:45:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57567-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=fsLMUKHo; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-57567-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57567-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 235D71F233C8 for ; Thu, 8 Feb 2024 07:45:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3304B6A008; Thu, 8 Feb 2024 07:45:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fsLMUKHo" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E40475B1E2 for ; Thu, 8 Feb 2024 07:45:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707378318; cv=none; b=Cvsnqm1Px47wrNLHQ6orHsEpCLWN4DUICTRibYfutilGTh/9biAI+5b15Ru6zMueXNEeRCUWIbpRd5yubke0vno33jw0Dpj0TkhX53bV7cIxmDKaKjA9AiDfSEg0DXgk4IK+bqgnMZ8I2NjOW7kcuw13OY1dAihSOEEOhp2c7S0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707378318; c=relaxed/simple; bh=roVpI7QEG+N3Gp757y+PaAvh5MTMMTwStLishWClXg8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=SRnfShcumIP+/cL/VBPtDmDEpax0UBMLaZx23m05rot+j98RRI5VjkYKTcD2BUIQX8apV5W8NY+4UGWgT69SIznjp9smKbx+uwvVbZ2aDgQc+OYvQUX+v2Ecr1M8l8HCus7sNmvbyg4HawIuPJeYYXekgRDiXoGCMRmQtGTvCxg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=fsLMUKHo; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707378317; x=1738914317; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=roVpI7QEG+N3Gp757y+PaAvh5MTMMTwStLishWClXg8=; b=fsLMUKHobw0l02PjV4u+HlFomM4aJnF9Qb98q1OBYNCBMuK5fgqiLBm+ IAWZ+P/aUDcqcrK3VvGavabIouIF3l0cA8g21VbR85rCsJp7XFhC0lqWj on/cId/lffGdS2kI8/SfgHucb8zibQqsrK/8JEZNbs/tkVFcXelgz71eB /6Gyn2VqMTOAlNuHHQHWmBCUAHF7tQB73AncUERqLY0rIpt22ghkwXHUJ IUDuVzfUg/LmdKEg6kNbd+o5AskjRqfoxk3+QmWydy6+m488rCanfGdG0 LYsxHai+7Y1wC8nuJlo+onvOQYtQBKhWHiwmwA1jPfY9zzKJ3WqIIx/R3 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10977"; a="12242632" X-IronPort-AV: E=Sophos;i="6.05,252,1701158400"; d="scan'208";a="12242632" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2024 23:45:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,252,1701158400"; d="scan'208";a="6195645" Received: from lucas-s2600cw.jf.intel.com ([10.165.21.196]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Feb 2024 23:45:16 -0800 From: Lucas De Marchi To: Yury Norov Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Andy Shevchenko , Jani Nikula , intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Lucas De Marchi Subject: [PATCH v3 0/3] Fixed-type GENMASK/BIT Date: Wed, 7 Feb 2024 23:45:18 -0800 Message-ID: <20240208074521.577076-1-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790315949834136264 X-GMAIL-MSGID: 1790315949834136264 ove the implementation of REG_GENMASK/REG_BIT to a more appropriate place to be shared by i915, xe and possibly other parts of the kernel. For now this re-defines the old macros. In future we may start using the new macros directly, but that's a more intrusive search-and-replace. Changes from v2: - Document both in commit message and code about the strict type checking and give examples how it´d break with invalid params. v1: https://lore.kernel.org/intel-xe/20230509051403.2748545-1-lucas.demarchi@intel.com/ v2: https://lore.kernel.org/intel-xe/20240124050205.3646390-1-lucas.demarchi@intel.com Lucas De Marchi (2): bits: Introduce fixed-type BIT drm/i915: Convert REG_GENMASK* to fixed-width GENMASK_* Yury Norov (1): bits: introduce fixed-type genmasks drivers/gpu/drm/i915/i915_reg_defs.h | 108 +++------------------------ include/linux/bitops.h | 1 - include/linux/bits.h | 51 ++++++++++--- 3 files changed, 51 insertions(+), 109 deletions(-)