lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 9 Feb 2018 14:19:41 -0800
From:   Matthias Kaehlcke <mka@...omium.org>
To:     Harry Wentland <harry.wentland@....com>
Cc:     Alex Deucher <alexander.deucher@....com>,
        Christian König <christian.koenig@....com>,
        David Zhou <David1.Zhou@....com>,
        David Airlie <airlied@...ux.ie>,
        Tony Cheng <Tony.Cheng@....com>,
        Dmytro Laktyushkin <Dmytro.Laktyushkin@....com>,
        amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org, Guenter Roeck <groeck@...omium.org>,
        Justin TerAvest <teravest@...omium.org>,
        Craig Bergstrom <craigb@...omium.org>
Subject: Re: [PATCH] amdgpu/dc: Add missing cast in
 dce_clock_set_min_clocks_state()

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@...omium.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!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ