lkml.org 
[lkml]   [2018]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] amdgpu/dc: Add missing cast in dce_clock_set_min_clocks_state()
Date
dce_clock_set_min_clocks_state() assigns (intentionally) a value of type
'enum dm_pp_clocks_state' to a variable of type 'enum dm_pp_power_level'
without an explicit cast. This causes clang to raise the following
warning:

drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_clocks.c:308:4: error:
implicit conversion from enumeration type 'enum dm_pp_clocks_state'
to different enumeration type 'enum dm_pp_power_level' [-Werror,-Wenum-conversion]
clocks_state };

Make the cast explicit.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c b/drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c
index 9e98a5f39a6d..db3ceb283255 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c
@@ -304,7 +304,8 @@ static bool dce_clock_set_min_clocks_state(
enum dm_pp_clocks_state clocks_state)
{
struct dm_pp_power_level_change_request level_change_req = {
- clocks_state };
+ .power_level = (enum dm_pp_power_level)clocks_state
+ };

if (clocks_state > clk->max_clks_state) {
/*Requested state exceeds max supported state.*/
--
2.16.0.rc1.238.g530d649a79-goog
\
 
 \ /
  Last update: 2018-02-09 22:29    [W:0.041 / U:0.992 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site