]> www.infradead.org Git - users/willy/xarray.git/commit
drm/amdgpu: Declare array with strings as pointers constant
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Sun, 3 Sep 2023 06:05:48 +0000 (11:35 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Sep 2023 18:34:11 +0000 (14:34 -0400)
commit9b70a1d4141369486561166aa864b8911ddec2dc
tree1a549f7a963540a09de748d6e9500591ba45cabb
parent14bf1c475f7fa1d6627746e7940d65d5456ab2b7
drm/amdgpu: Declare array with strings as pointers constant

This warning is for the declaration of a static array, and it is
recommended to declare it as type "static const char * const" instead of
"static const char *".

an array pointer declared as type "static const char *" can point to a
different character constant because the pointer is mutable. However, if
it is declared as type "static const char * const", the pointer will
point to an immutable character constant, preventing it from being
modified which can better ensure the safety and stability of the
program.

Fixes the below:

WARNING: static const char * array should probably be static const char * const

Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_2.c