Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp105920rdb; Wed, 7 Feb 2024 23:45:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVMqAn9D8t4mQvecORyggoXqjSrgYMNResb60E7m+skOvpz+nurlE3mKmDc+QKTwuVpfP1PbMeUF143BrVKiW2mugUsAEaSMeO3tSPcFQ== X-Google-Smtp-Source: AGHT+IHvUERqv+5jw20BJd3VPL2sP5j5H3/cTUBiByw8zCWbIoG1P4uKZZQ9CkdxCF9ul/ifU3OD X-Received: by 2002:ad4:5f8c:0:b0:68c:64d3:d98c with SMTP id jp12-20020ad45f8c000000b0068c64d3d98cmr10164090qvb.53.1707378352029; Wed, 07 Feb 2024 23:45:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707378352; cv=pass; d=google.com; s=arc-20160816; b=SUPFuOkoor/4baMPK2GYaCC9139Nm3PAUUihhob6Ak1piffSRrPRMXcCRF7/P/Ggd5 Fv1fCRZAOqDFUb1mgf/VZXmHxlVJXHEDsiqBT64za0h1pyh+u6bX3geA9ATR7Z4avn+s 2n9AF6TyvPXaKtzrITOhoSd0DxeYj8qqmcE4E36qG7bd6X3ciRHy7aaoLEg2lolAKgBS Tn+mU1YsNRRqvcL2eAIcJNIezG7ID4QW4lV6TN9r1A4CksziYKfStcBjqUBt9E6g3reA fqWObea/uz0ce6IqXx0jVQHWxDn84bAtLNfWxaUFTva2L8SrAFYc1estaU9qXj2bIUar pLZQ== 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=3XFgJ7a3V0XHURtl0OArA+k/IC7rel56FlZdYCw6rfY=; b=g0SIQkY+NdPJqokRs9Ia8bMtfvnTawhQFqhHk5AQt5Hkn8TXH1nNXBaa5JJ+2cDyb8 ohX3btDOONTehtx4LvhgYdflPHMRTywmxFFp2jlWPWPWbkVx9QY7esPCqQNgo7+UvsK9 TpJGk8gus/mZdj3ziakIIPxZIXxF/MzRMAYtDYgt5boVTbUb+j6DQ92WKV0s6vh8lCqv f9XcNodyQEKyT9GHpuaNdu5ornj7KLutQvQMEVrNQ23aXf4DqmK6BPj9vLRbc5fvN632 WSea4ZcdDAgsr1gpvJj3Xz7VfCah0LhV76JeHhEAdH7+AC8SMdehgw/ZYN3Cmj2TUtBO fWvA==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57567-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=2; AJvYcCVZyPiyt5JxHM1FoCMKNYWBH4DW7lEgz/4/zYXAnXZBcHN4DeH1+1sz46nurvwCKlIi9yZXJjR2ahdxsKMtju41XHw9otMZIyKSMiGLug== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id cw9-20020ad44dc9000000b0068cb1144b78si2720185qvb.74.2024.02.07.23.45.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 23:45:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57567-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57567-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 6A21A1C25369 for ; Thu, 8 Feb 2024 07:45:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A1DA69D30; Thu, 8 Feb 2024 07:45:19 +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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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(-) -- 2.43.0