[PATCH 5/5] drm/amdgpu: calculate actual size instead of hardcode size
Chen, Guchun
Guchun.Chen at amd.com
Wed Jul 22 14:29:17 UTC 2020
[AMD Public Use]
Hi Andrey,
Aha, thanks for your reminding, I ignore that comment. Let me update it later.
Regards,
Guchun
-----Original Message-----
From: Grodzovsky, Andrey <Andrey.Grodzovsky at amd.com>
Sent: Wednesday, July 22, 2020 10:26 PM
To: Chen, Guchun <Guchun.Chen at amd.com>; amd-gfx at lists.freedesktop.org; Deucher, Alexander <Alexander.Deucher at amd.com>; Zhang, Hawking <Hawking.Zhang at amd.com>; Li, Dennis <Dennis.Li at amd.com>; Yang, Stanley <Stanley.Yang at amd.com>; Zhou1, Tao <Tao.Zhou1 at amd.com>; Clements, John <John.Clements at amd.com>
Subject: Re: [PATCH 5/5] drm/amdgpu: calculate actual size instead of hardcode size
On 7/21/20 11:14 PM, Guchun Chen wrote:
> Use sizeof to get actual size.
>
> Signed-off-by: Guchun Chen <guchun.chen at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> index 96b63c026bad..a5da108e43c3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
> @@ -34,11 +34,9 @@
> /*
> * The 2 macros bellow represent the actual size in bytes that
> * those entities occupy in the EEPROM memory.
> - * EEPROM_TABLE_RECORD_SIZE is different than
> sizeof(eeprom_table_record) which
> - * uses uint64 to store 6b fields such as retired_page.
Did you find out the comment above was wrong ?
Andrey
> */
> -#define EEPROM_TABLE_HEADER_SIZE 20
> -#define EEPROM_TABLE_RECORD_SIZE 24
> +#define EEPROM_TABLE_HEADER_SIZE (sizeof(struct
> +amdgpu_ras_eeprom_table_header)) #define EEPROM_TABLE_RECORD_SIZE
> +(sizeof(struct eeprom_table_record))
>
> #define EEPROM_ADDRESS_SIZE 0x2
>
More information about the amd-gfx
mailing list