Re: tidy'ing up cz_hwmgr.c

2016-08-18 Thread StDenis, Tom
Sent: Thursday, August 18, 2016 12:07 To: StDenis, Tom; Deucher, Alexander Cc: amd-gfx list Subject: Re: tidy'ing up cz_hwmgr.c Either way like I said I'm not strongly motivated to change it just caught my attention. Well if you have time it would be really cool if you could a) identify s

Re: tidy'ing up cz_hwmgr.c

2016-08-18 Thread Christian König
, August 18, 2016 11:40 AM *To:* Alex Deucher *Cc:* Christian König; amd-gfx list *Subject:* Re: tidy'ing up cz_hwmgr.c It had to be something more complicated because this demo program #include #include struct one { char *foo; int bar[0]; }; struct two { char *foo; int bar[1]; }

Re: tidy'ing up cz_hwmgr.c

2016-08-18 Thread StDenis, Tom
x27;m not strongly motivated to change it just caught my attention. Cheers, Tom From: Deucher, Alexander Sent: Thursday, August 18, 2016 11:50 To: StDenis, Tom; Alex Deucher Cc: Christian König; amd-gfx list Subject: RE: tidy'ing up cz_hwmgr.c IIRC,

RE: tidy'ing up cz_hwmgr.c

2016-08-18 Thread Deucher, Alexander
Alex Deucher Cc: Christian König; amd-gfx list Subject: Re: tidy'ing up cz_hwmgr.c It had to be something more complicated because this demo program #include #include struct one { char *foo; int bar[0]; }; struct two { char *foo; int bar[1]; }; int main(void) { struct one *a = calloc(

Re: tidy'ing up cz_hwmgr.c

2016-08-18 Thread Christian König
size of the struct) but then fill 8 slots. It's just weird 😊 Using [0] in the struct and allocating for 8 entries makes more sense and is clearer to read. Tom ---- *From:* Christian König mailto:

Re: tidy'ing up cz_hwmgr.c

2016-08-18 Thread StDenis, Tom
fd4044 Which is exactly what you'd expect. I'm not strongly advocating we change the PP code just noting it's not really clear that it's correct from a first reading and in theory would be better with [0]. Tom From: Alex Deucher Sent: Thu

Re: tidy'ing up cz_hwmgr.c

2016-08-18 Thread Alex Deucher
e sense and > is clearer to read. > > > Tom > > > -- > *From:* Christian König > *Sent:* Thursday, August 18, 2016 11:17 > *To:* StDenis, Tom; amd-gfx list > *Subject:* Re: tidy'ing up cz_hwmgr.c > > > Has a [1] array at the tail which is then kzallo

Re: tidy'ing up cz_hwmgr.c

2016-08-18 Thread StDenis, Tom
nd is clearer to read. Tom From: Christian König Sent: Thursday, August 18, 2016 11:17 To: StDenis, Tom; amd-gfx list Subject: Re: tidy'ing up cz_hwmgr.c Has a [1] array at the tail which is then kzalloc'ed with N-1 entries. Shouldn't that just be

Re: tidy'ing up cz_hwmgr.c

2016-08-18 Thread Christian König
Has a [1] array at the tail which is then kzalloc'ed with N-1 entries. Shouldn't that just be a [0] with N entries allocated for clarity? Actually the starting address of a dynamic array should be manually calculated instead of using [1] or [0]. We had tons of problems with that because some g

tidy'ing up cz_hwmgr.c

2016-08-18 Thread StDenis, Tom
Tidying up cz_hwmgr.c I noted a couple of things but first is static bool cz_dpm_check_smu_features(struct pp_hwmgr *hwmgr, unsigned long check_feature); Which will return "true" if the smu call fails or the feature is set. The structure struct phm_clock_voltage_dependency_table; Has a [1] ar