drm/amd/pm: change pmfw_decoded_link_width,speed variables to globals
Subsystems (3)
PATCH 1/1 drm/amd/pm: change pmfw_decoded_link_width,speed variables to globals
gcc with W=1 reports
In file included from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0.c:36:./drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v13_0.h:66:18: error:
‘pmfw_decoded_link_width’ defined but not used [-Werror=unused-const-variable=]
66 | static const int pmfw_decoded_link_width[7] = {0, 1, 2, 4, 8, 12, 16};
| ^~~~~~~~~~~~~~~~~~~~~~~
./drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v13_0.h:65:18: error:
‘pmfw_decoded_link_speed’ defined but not used [-Werror=unused-const-variable=]
65 | static const int pmfw_decoded_link_speed[5] = {1, 2, 3, 4, 5};
| ^~~~~~~~~~~~~~~~~~~~~~~These variables are defined and used in smu_v13_0_7_ppt.c and smu_v13_0_0_ppt.c. There should be only one definition. So define the variables as globals in smu_v13_0.c
--- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 4 ++-- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +2 -2
@@ -62,8 +62,8 @@#define CTF_OFFSET_HOTSPOT 5#define CTF_OFFSET_MEM 5 -static const int pmfw_decoded_link_speed[5 ] = {1 ,2 ,3 ,4 ,5 }; -static const int pmfw_decoded_link_width[7 ] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +extern const int pmfw_decoded_link_speed[5 ]; +extern const int pmfw_decoded_link_width[7 ];#define DECODE_GEN_SPEED (gen_speed_idx) (pmfw_decoded_link_speed[gen_speed_idx])#define DECODE_LANE_WIDTH (lane_width_idx) (pmfw_decoded_link_width[lane_width_idx])
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +3 -0
@@ -85,6 +85,9 @@ MODULE_FIRMWARE("amdgpu/smu_13_0_10.bin");static const int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 };static const int link_speed[] = {25 ,50 ,80 ,160 }; +const int pmfw_decoded_link_speed[5 ] = {1 ,2 ,3 ,4 ,5 }; +const int pmfw_decoded_link_width[7 ] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +int smu_v13_0_init_microcode (struct smu_context *smu) {struct amdgpu_device *adev = smu->adev;
Signature · 1 line
2.27.0
Alex Deucher
AppliedRe: [PATCH] drm/amd/pm: change pmfw_decoded_link_width, speed variables to globals
Applied. Thanks!
Alex
Quoted 54 lines · Tom Rix
gcc with W=1 reports
In file included fromdrivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0.c:36:./drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v13_0.h:66:18: error:
‘pmfw_decoded_link_width’ defined but not used [-Werror=unused-const-variable=]66 | static const int pmfw_decoded_link_width[7] = {0, 1, 2, 4, 8, 12, 16}; | ^~~~~~~~~~~~~~~~~~~~~~~ ./drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v13_0.h:65:18: error: ‘pmfw_decoded_link_speed’ defined but not used [-Werror=unused-const-variable=] 65 | static const int pmfw_decoded_link_speed[5] = {1, 2, 3, 4, 5}; | ^~~~~~~~~~~~~~~~~~~~~~~These variables are defined and used in
smu_v13_0_7_ppt.candsmu_v13_0_0_ppt.c. There should be only one definition. So define the variables as globals insmu_v13_0.cSigned-off-by Tom Rix <[email protected]>--- drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 4 ++-- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +2
-2@@ -62,8 +62,8 @@#define CTF_OFFSET_HOTSPOT 5#define CTF_OFFSET_MEM 5 -static const int pmfw_decoded_link_speed[5 ] = {1 ,2 ,3 ,4 ,5 }; -static const int pmfw_decoded_link_width[7 ] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +extern const int pmfw_decoded_link_speed[5 ]; +extern const int pmfw_decoded_link_width[7 ];#define DECODE_GEN_SPEED (gen_speed_idx) (pmfw_decoded_link_speed[gen_speed_idx])#define DECODE_LANE_WIDTH (lane_width_idx) (pmfw_decoded_link_width[lane_width_idx])drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +3
-1@@ -85,6 +85,9 @@ MODULE_FIRMWARE("amdgpu/smu_13_0_10.bin");static const int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 };static const int link_speed[] = {25 ,50 ,80 ,160 }; +const int pmfw_decoded_link_speed[5 ] = {1 ,2 ,3 ,4 ,5 }; +const int pmfw_decoded_link_width[7 ] = {0 ,1 ,2 ,4 ,8 ,12 ,16 }; +int smu_v13_0_init_microcode (struct smu_context *smu) {struct amdgpu_device *adev = smu->adev; --2.27.0