From: Harry Wentland <harry.wentland@amd.com>
To: "Matthias Kaehlcke" <mka@chromium.org>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Zhou" <David1.Zhou@amd.com>,
"David Airlie" <airlied@linux.ie>,
"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>
Subject: Re: [PATCH] amdgpu/dc: Add missing cast in dce_clock_set_min_clocks_state()
Date: Fri, 9 Feb 2018 16:55:57 -0500 [thread overview]
Message-ID: <95c4b316-ee97-d7c9-a9d8-f2a7e0daa9e3@amd.com> (raw)
In-Reply-To: <20180209212834.72129-1-mka@chromium.org>
On 2018-02-09 04:28 PM, Matthias Kaehlcke wrote:
> 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
Thanks for spotting this. Looks like both enums are exactly the same so no need to keep both. I sent a patch to remove the dm_pp_power_level enum to amd-gfx and CC'd you on it.
Harry
> + };
>
> if (clocks_state > clk->max_clks_state) {
> /*Requested state exceeds max supported state.*/
>
next prev parent reply other threads:[~2018-02-09 21:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 21:28 Matthias Kaehlcke
2018-02-09 21:55 ` Harry Wentland [this message]
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=95c4b316-ee97-d7c9-a9d8-f2a7e0daa9e3@amd.com \
--to=harry.wentland@amd.com \
--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=linux-kernel@vger.kernel.org \
--cc=mka@chromium.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®