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
, 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];
}
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,
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(
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:
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
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
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
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
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
10 matches
Mail list logo