From: Matthias Kaehlcke <mka@chromium.org>
To: Harry Wentland <harry.wentland@amd.com>
Cc: "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>,
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 14:19:41 -0800 [thread overview]
Message-ID: <20180209221941.GA79106@google.com> (raw)
In-Reply-To: <95c4b316-ee97-d7c9-a9d8-f2a7e0daa9e3@amd.com>
El Fri, Feb 09, 2018 at 04:55:57PM -0500 Harry Wentland ha dit:
> 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.
Even better, thanks!
prev parent reply other threads:[~2018-02-09 22:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 21:28 [PATCH] amdgpu/dc: Add missing cast in dce_clock_set_min_clocks_state() Matthias Kaehlcke
2018-02-09 21:55 ` Harry Wentland
2018-02-09 22:19 ` Matthias Kaehlcke [this message]
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=20180209221941.GA79106@google.com \
--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;
as well as URLs for NNTP newsgroup(s).