From nobody Thu Apr 9 15:01:24 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) (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 750AF3CCFD1 for ; Tue, 7 Apr 2026 16:02:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775577770; cv=none; b=NtiCaqvRervSAm+fHhPcfz0eRXcFJiCEglRmWv5fDEk2Qq3GBKVaqFhoDUBdkQpi9nQYb4GIcPlIdZ2ocbp7ouMqKnPuypV65XMerN65jkYHA9v2PpZSYUcCHDcI+8XpvZF3Unvu69j2JDITgRMfauoOrUBQPTeaHcUvVLY2XXc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775577770; c=relaxed/simple; bh=arnafYuhnaMZc+KiEcaSFFq8ZsggDT06JfSKTL923xY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QZDd/E1ljwsqIG/CCE8Fneuulk5WODVxk9ra31oLvmkQ1mJqkgNwImQiMerBAbGh1QCb+ax0CGMOc5eIYPm5H0X9goVNH2+q8ePKEhUt+vI0vovgvp+tG1mroIkKh2LHbUTK0BDr9UgDH7zkO6jkEFDrkcFVxvZ/ggUMx/Y2jyo= 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=ENY6hsMO; arc=none smtp.client-ip=192.198.163.12 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ENY6hsMO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775577763; x=1807113763; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=arnafYuhnaMZc+KiEcaSFFq8ZsggDT06JfSKTL923xY=; b=ENY6hsMO5jJeH9ylJtP5eQvqO45sCfkUPmdUAYxryYppgF6U4mlZslNC sk9cwXNEGXZkcloWlARFF9Orakisya92C+a6cstXQSuRuWDtjdLgjxphW pwdNc8X/1G95ZwGpeiUXYMd/kzQAVxHnllPQ+Dxq3kKppsgj8UhvUL9Jc 6G5XXBySU8GGPSfBOP9eFjwwhbD19rdCYNW1HlZ9GjtVTe6UVgvnA/Bea A4lj3HFCTtG0ivcElpTbVrIhzP9yM7kmjt9BKPjaJ0zk8WMDS+nziuhC0 GdGAyquMMGJEwgtcokYL9zpntXP1WwGpwPaFMtQ90mZ/r6Zqx/GQSN0t0 w==; X-CSE-ConnectionGUID: S1LgrwPCTRCQxiplR/35pg== X-CSE-MsgGUID: ZIjh7VG1RVSMP03EWQr0Ug== X-IronPort-AV: E=McAfee;i="6800,10657,11752"; a="80432679" X-IronPort-AV: E=Sophos;i="6.23,165,1770624000"; d="scan'208";a="80432679" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2026 09:02:19 -0700 X-CSE-ConnectionGUID: 7bd/vY/9Q5metcBEUxCBgQ== X-CSE-MsgGUID: w9yQiyHIQvytEWAeAZJ5MQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,165,1770624000"; d="scan'208";a="228119046" Received: from rchatre-desk1.jf.intel.com ([10.165.154.99]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2026 09:02:18 -0700 From: Reinette Chatre To: tony.luck@intel.com, james.morse@arm.com, Dave.Martin@arm.com, babu.moger@amd.com, bp@alien8.de, tglx@linutronix.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, hpa@zytor.com, ben.horgan@arm.com, fustini@kernel.org, fenghuay@nvidia.com, peternewman@google.com, linux-kernel@vger.kernel.org, patches@lists.linux.dev, reinette.chatre@intel.com Subject: [PATCH v3 06/13] fs/resctrl: Change pattern used to track number of entries in enum Date: Tue, 7 Apr 2026 09:02:03 -0700 Message-ID: <0a7a65609a1d3b5b734716287fba59ef702e5b42.1775576382.git.reinette.chatre@intel.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" CDP_NUM_TYPES tracks the number of different configuration types that can be applied to a resource. CDP_NUM_TYPES is required to iterate over the different configurations but is not a member of enum resctrl_conf_type to avoid the warning generated with -Wswitch when CDP_NUM_TYPES lacks a case. Add a new CDP_LAST enum entry used in CDP_NUM_TYPES definition to simplify adding a new enum entry. Do this to create a cleaner pattern for tracking the number of enum entries in resctrl in preparation for other enums needing to do so. Suggested-by: Ben Horgan Signed-off-by: Reinette Chatre Reviewed-by: Ben Horgan --- Changes since v2: - Add Ben's RB tag. --- include/linux/resctrl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h index 006e57fd7ca5..0b28049378c8 100644 --- a/include/linux/resctrl.h +++ b/include/linux/resctrl.h @@ -69,9 +69,10 @@ enum resctrl_conf_type { CDP_NONE, CDP_CODE, CDP_DATA, + CDP_LAST =3D CDP_DATA }; =20 -#define CDP_NUM_TYPES (CDP_DATA + 1) +#define CDP_NUM_TYPES (CDP_LAST + 1) =20 /* * struct pseudo_lock_region - pseudo-lock region information --=20 2.50.1