Skip to contentSkip to conversation

drm/amdgpu: make the read-only const array fw_err_code_msg static

PATCH In review Colin Ian King 2 participants 2 messages Nov 10 – Nov 11

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

---
 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
index d025b4183b29..91c863649972 100644
@@ -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
#1 lore raw

Reviewed and applied. Thanks!

Quoted 25 lines · Colin Ian King

Don't populate the read-only const array fw_err_code_msg on the stack at run time, instead make it static

---
 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
index d025b4183b29..91c863649972 100644
@@ -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