2023-08-02 02:33:09

by Ran Sun

[permalink] [raw]
Subject: [PATCH] drm/amd/pm: Clean up errors in smu8_smumgr.h

Fix the following errors reported by checkpatch:

ERROR: Use C99 flexible arrays

Signed-off-by: Ran Sun <[email protected]>
---
drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h
index c7b61222d258..475ffcf743d2 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h
+++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h
@@ -73,7 +73,7 @@ struct smu8_register_index_data_pair {

struct smu8_ih_meta_data {
uint32_t command;
- struct smu8_register_index_data_pair register_index_value_pair[1];
+ struct smu8_register_index_data_pair register_index_value_pair[0];
};

struct smu8_smumgr {
--
2.17.1



2023-08-07 18:23:39

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH] drm/amd/pm: Clean up errors in smu8_smumgr.h

Need to be careful with these changes to make sure we aren't changing
the size calculations somewhere.

Alex

On Tue, Aug 1, 2023 at 10:03 PM Ran Sun <[email protected]> wrote:
>
> Fix the following errors reported by checkpatch:
>
> ERROR: Use C99 flexible arrays
>
> Signed-off-by: Ran Sun <[email protected]>
> ---
> drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h
> index c7b61222d258..475ffcf743d2 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/smu8_smumgr.h
> @@ -73,7 +73,7 @@ struct smu8_register_index_data_pair {
>
> struct smu8_ih_meta_data {
> uint32_t command;
> - struct smu8_register_index_data_pair register_index_value_pair[1];
> + struct smu8_register_index_data_pair register_index_value_pair[0];
> };
>
> struct smu8_smumgr {
> --
> 2.17.1
>