drm/amd/powerplay: Use proper enums in vega20_print_clk_levels
authorNathan Chancellor <natechancellor@gmail.com>
Thu, 4 Jul 2019 05:52:17 +0000 (22:52 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Jul 2019 19:49:57 +0000 (14:49 -0500)
clang warns:

drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c:995:39: warning:
implicit conversion from enumeration type 'PPCLK_e' to different
enumeration type 'enum smu_clk_type' [-Wenum-conversion]
                ret = smu_get_current_clk_freq(smu, PPCLK_SOCCLK, &now);
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c:1016:39: warning:
implicit conversion from enumeration type 'PPCLK_e' to different
enumeration type 'enum smu_clk_type' [-Wenum-conversion]
                ret = smu_get_current_clk_freq(smu, PPCLK_FCLK, &now);
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../powerplay/vega20_ppt.c:1031:39: warning:
implicit conversion from enumeration type 'PPCLK_e' to different
enumeration type 'enum smu_clk_type' [-Wenum-conversion]
                ret = smu_get_current_clk_freq(smu, PPCLK_DCEFCLK, &now);
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~

The values are mapped one to one in vega20_get_smu_clk_index so just use
the proper enums here.

Fixes: 096761014227 ("drm/amd/powerplay: support sysfs to get socclk, fclk, dcefclk")
Link: https://github.com/ClangBuiltLinux/linux/issues/587
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/vega20_ppt.c

index a76a22a18eb451ad60a900a5a99f31a33ee336a0..9204e4e50d09c06a5ee0d6954af5d1d221cbfe99 100644 (file)
@@ -992,7 +992,7 @@ static int vega20_print_clk_levels(struct smu_context *smu,
                break;
 
        case SMU_SOCCLK:
-               ret = smu_get_current_clk_freq(smu, PPCLK_SOCCLK, &now);
+               ret = smu_get_current_clk_freq(smu, SMU_SOCCLK, &now);
                if (ret) {
                        pr_err("Attempt to get current socclk Failed!");
                        return ret;
@@ -1013,7 +1013,7 @@ static int vega20_print_clk_levels(struct smu_context *smu,
                break;
 
        case SMU_FCLK:
-               ret = smu_get_current_clk_freq(smu, PPCLK_FCLK, &now);
+               ret = smu_get_current_clk_freq(smu, SMU_FCLK, &now);
                if (ret) {
                        pr_err("Attempt to get current fclk Failed!");
                        return ret;
@@ -1028,7 +1028,7 @@ static int vega20_print_clk_levels(struct smu_context *smu,
                break;
 
        case SMU_DCEFCLK:
-               ret = smu_get_current_clk_freq(smu, PPCLK_DCEFCLK, &now);
+               ret = smu_get_current_clk_freq(smu, SMU_DCEFCLK, &now);
                if (ret) {
                        pr_err("Attempt to get current dcefclk Failed!");
                        return ret;