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

James Morse
2025-04-24T17:08:17Z

Hi Reinette,

On 16/04/2025 03:14, Reinette Chatre wrote:
> 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

Thanks that's better. I think I removed a 'for' as 'for for_each...' looked like
a duplicate word...

Thanks,

James