Re: [PATCH v8 16/21] x86/resctrl: Always initialise rid field in rdt_resources_all[]

Reinette Chatre
2025-04-16T02:14:49Z

Hi James,

On 4/11/25 9:42 AM, James Morse wrote:

> @@ -996,7 +992,11 @@ void resctrl_cpu_detect(struct cpuinfo_x86 *c)
> static int __init resctrl_arch_late_init(void)
> {
> struct rdt_resource *r;
> - int state, ret;
> + int state, ret, i;
> +
> + /* Initialise all rid values for_each_rdt_resource() */

I find the above difficult to parse. How about:
/* for_each_rdt_resource() requires all rid to be initialised. */

> + for (i = 0; i < RDT_NUM_RESOURCES; i++)
> + rdt_resources_all[i].r_resctrl.rid = i;
>
> /*
> * Initialize functions(or definitions) that are different

Reinette