summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorReinette Chatre <reinette.chatre@intel.com>2026-06-30 21:27:04 -0700
committerBorislav Petkov (AMD) <bp@alien8.de>2026-07-23 13:10:52 -0700
commit6cf4970e9d02556cfcfb682a99044d5191a25d29 (patch)
tree6570582edfde79a630c65bf64b7eab3b4759dcd1 /tools/lib/python
parentb3d683bf761d95716e60d6628eed802ad341d895 (diff)
fs/resctrl: Use accurate type for rdt_resource::rid
Every resctrl resource has a unique ID described by enum resctrl_res_level. enum resctrl_res_level is used in all resource ID initializations and all resource ID comparisons. All functions consuming the resource ID expects an enum resctrl_res_level. Of the four structures that contain a resource ID (struct mon_data, struct mon_evt, struct rdt_domain_hdr, and struct rdt_resource) only struct rdt_resource does not use enum resctrl_res_level. Switch the type of rdt_resource::rid to be enum resctrl_res_level to make it obvious what values are valid, match the type everywhere this member is used, and obtain benefits from tools that can flag any enum misuse. Move define of RDT_NUM_RESOURCES outside the enum to enable tools to catch when a switch() on the resource ID does not handle all the resources and thus help flag which switch statements need an update when a new resource is added. Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Ben Horgan <ben.horgan@arm.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Link: https://patch.msgid.link/926b334c50b00b4b763c983c0dca6d4ec9083d60.1782857711.git.reinette.chatre@intel.com
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions