diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 0f4ebae551070..4dda5dd1e0578 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -1035,7 +1035,7 @@ struct amdgpu_device { /* Chip product information */ char product_number[16]; char product_name[32]; - char serial[16]; + char serial[20]; struct amdgpu_autodump autodump; diff --git a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c index df7b408319f76..d58146a5fa21d 100644 --- a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c @@ -2265,8 +2265,7 @@ static void arcturus_i2c_eeprom_control_fini(struct i2c_adapter *control) static void arcturus_get_unique_id(struct smu_context *smu) { struct amdgpu_device *adev = smu->adev; - uint32_t top32, bottom32, smu_version, size; - char sn[16]; + uint32_t top32, bottom32, smu_version; uint64_t id; if (smu_get_smc_version(smu, NULL, &smu_version)) { @@ -2289,8 +2288,7 @@ static void arcturus_get_unique_id(struct smu_context *smu) /* For Arcturus-and-later, unique_id == serial_number, so convert it to a * 16-digit HEX string for convenience and backwards-compatibility */ - size = sprintf(sn, "%llx", id); - memcpy(adev->serial, &sn, size); + sprintf(adev->serial, "%llx", id); } static bool arcturus_is_baco_supported(struct smu_context *smu)