Re: [PATCH] drm/amdgpu: Fix the incomplete product number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 20.07.22 um 16:26 schrieb André Almeida:
Às 05:26 de 20/07/22, Roy Sun escreveu:
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.


Signed-off-by: Roy Sun <Roy.Sun@xxxxxxx>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 9f729a648005..187e3dae3965 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -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?

That's the next multiple of 4 and so avoids alignment issues.


Christian.


  	char				product_name[AMDGPU_PRODUCT_NAME_LEN];
  	char				serial[20];




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux