drm/amdgpu: make the read-only const array fw_err_code_msg static
Subsystems (3)
PATCH 1/1 drm/amdgpu: make the read-only const array fw_err_code_msg static
Don't populate the read-only const array fw_err_code_msg on the stack at run time, instead make it static
Signed-off-by Colin Ian King <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c +1 -1
@@ -5427,7 +5427,7 @@ static int amdgpu_ualink_metadata_init(struct amdgpu_device *adev)*/ static void amdgpu_ualink_remote_error (struct amdgpu_device *adev,u32 status) { -const char *fw_err_code_msg[] = { +static const char *const fw_err_code_msg[] = {"Unknown FW error status" ,"FIFO overflow" ,/* error code 1 */ "Invalid RB command" ,
Signature · 1 line
2.55.0
Reviewed and applied. Thanks!
Quoted 25 lines · Colin Ian King
Don't populate the read-only const array
fw_err_code_msgon the stack at run time, instead make it staticSigned-off-by Colin Ian King <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c +1
-2@@ -5427,7 +5427,7 @@ static int amdgpu_ualink_metadata_init(struct amdgpu_device *adev)*/ static void amdgpu_ualink_remote_error (struct amdgpu_device *adev,u32 status) { - const char *fw_err_code_msg[] = { +static const char *const fw_err_code_msg[] = {"Unknown FW error status" ,"FIFO overflow" ,/* error code 1 */ "Invalid RB command" , --2.55.0