drm/amdgpu: Fix the incomplete product number
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix the incomplete product number
The comments say that the product number is a 16-digit HEX string so the buffer needs to be at least 17 characters to hold the NUL terminator.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
@@ -1019,7 +1019,7 @@ struct amdgpu_device {bool psp_sysfs_en;/* Chip product information */ -char product_number[16 ]; +char product_number[20 ];char product_name[AMDGPU_PRODUCT_NAME_LEN ];char serial[20 ];
Signature · 1 line
2.34.1
[AMD Official Use Only - General]
Double checked.
BR
Roy
________________________________
From: Roy Sun <[email protected]>
Sent: Wednesday, July 20, 2022 4:26 PM
To: [email protected] <[email protected]>
Cc: Sun, Roy <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix the incomplete product number
The comments say that the product number is a 16-digit HEX string so the buffer needs to be at least 17 characters to hold the NUL terminator.
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
@@ -1019,7 +1019,7 @@ struct amdgpu_device {bool psp_sysfs_en;/* Chip product information */ -char product_number[16 ]; +char product_number[20 ];char product_name[AMDGPU_PRODUCT_NAME_LEN ];char serial[20 ];
--
2.34.1
Am 20.07.22 um 10:26 schrieb Roy Sun:
Quoted 4 lines
The comments say that the product number is a 16-digit HEX string so the buffer needs to be at least 17 characters to hold the NUL terminator.
Signed-off-by Roy Sun <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +1
-1@@ -1019,7 +1019,7 @@ struct amdgpu_device {bool psp_sysfs_en;/* Chip product information */ -char product_number[16 ]; +char product_number[20 ];char product_name[AMDGPU_PRODUCT_NAME_LEN ];char serial[20 ];
Às 05:26 de 20/07/22, Roy Sun escreveu:
Quoted 3 lines
The comments say that the product number is a 16-digit HEX string so the buffer needs to be at least 17 characters to hold the NUL terminator.
Which comment?
Quoted 10 lines
Signed-off-by Roy Sun <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu.h struct amdgpu_device { · line 1022
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1
-1@@ -1019,7 +1019,7 @@ struct amdgpu_device {bool psp_sysfs_en;/* Chip product information */ -char product_number[16 ]; +char product_number[20 ];
If 17 is enough, why setting as 20?
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0char product_name[AMDGPU_PRODUCT_NAME_LEN ];char serial[20 ];
Am 20.07.22 um 16:26 schrieb André Almeida:
Quoted 5 lines
Às 05:26 de 20/07/22, Roy Sun escreveu:
Quoted 3 lines
The comments say that the product number is a 16-digit HEX string so the buffer needs to be at least 17 characters to hold the NUL terminator.
Which comment?
In internal documentation of the eeprom layout I think.
Quoted 13 lines
Quoted 13 lines
Signed-off-by Roy Sun <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0@@ -1019,7 +1019,7 @@ struct amdgpu_device {bool psp_sysfs_en;
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h struct amdgpu_device { · line 1022
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1
-1/* Chip product information */ -char product_number[16 ]; +char product_number[20 ];If 17 is enough, why setting as 20?
That's the next multiple of 4 and so avoids alignment issues.
Christian.
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu.h +0
-0char product_name[AMDGPU_PRODUCT_NAME_LEN ];char serial[20 ];
Às 05:26 de 20/07/22, Roy Sun escreveu:
Quoted 5 lines
The comments say that the product number is a 16-digit HEX string so the buffer needs to be at least 17 characters to hold the NUL terminator.
Signed-off-by Roy Sun <[email protected]>---
...but I would appreciate a more detailed commit message with the points I raised in the review