From: Matthias Kaehlcke <mka@chromium.org>
To: "Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Zhou" <David1.Zhou@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Harry Wentland" <harry.wentland@amd.com>,
"Tony Cheng" <Tony.Cheng@amd.com>,
"Dmytro Laktyushkin" <Dmytro.Laktyushkin@amd.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, Guenter Roeck <groeck@chromium.org>,
Justin TerAvest <teravest@chromium.org>,
Craig Bergstrom <craigb@chromium.org>,
Matthias Kaehlcke <mka@chromium.org>
Subject: [PATCH] amdgpu/dc: Add missing cast in dce_clock_set_min_clocks_state()
Date: Fri, 9 Feb 2018 13:28:34 -0800 [thread overview]
Message-ID: <20180209212834.72129-1-mka@chromium.org> (raw)
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
next reply other threads:[~2018-02-09 21:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 21:28 Matthias Kaehlcke [this message]
2018-02-09 21:55 ` Harry Wentland
2018-02-09 22:19 ` Matthias Kaehlcke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180209212834.72129-1-mka@chromium.org \
--to=mka@chromium.org \
--cc=David1.Zhou@amd.com \
--cc=Dmytro.Laktyushkin@amd.com \
--cc=Tony.Cheng@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=craigb@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=groeck@chromium.org \
--cc=harry.wentland@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=teravest@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®