Re: [PATCH 1/3] powerpc/smp: Parse ibm,thread-groups with multiple properties
From: Michael Ellerman
Date: Tue Dec 08 2020 - 23:00:33 EST
Gautham R Shenoy <ego@xxxxxxxxxxxxxxxxxx> writes:
> Hello Srikar,
>
> Thanks for taking a look at the patch.
>
> On Mon, Dec 07, 2020 at 05:40:42PM +0530, Srikar Dronamraju wrote:
>> * Gautham R. Shenoy <ego@xxxxxxxxxxxxxxxxxx> [2020-12-04 10:18:45]:
>>
>> > From: "Gautham R. Shenoy" <ego@xxxxxxxxxxxxxxxxxx>
>>
>> <snipped>
>>
>> >
>> > static int parse_thread_groups(struct device_node *dn,
>> > - struct thread_groups *tg,
>> > - unsigned int property)
>> > + struct thread_groups_list *tglp)
>> > {
>> > - int i;
>> > - u32 thread_group_array[3 + MAX_THREAD_LIST_SIZE];
>> > + int i = 0;
>> > + u32 *thread_group_array;
>> > u32 *thread_list;
>> > size_t total_threads;
>> > - int ret;
>> > + int ret = 0, count;
>> > + unsigned int property_idx = 0;
>>
>> NIT:
>> tglx mentions in one of his recent comments to try keep a reverse fir tree
>> ordering of variables where possible.
>
> I suppose you mean moving the longer local variable declarations to to
> the top and shorter ones to the bottom. Thanks. Will fix this.
Yeah. It's called "reverse christmas tree", that's googleable.
I also prefer that style, it makes the locals visually sit with the
beginning of the function body.
cheers