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-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jJ3Sa8Kj7JSFBfKn=35FSyGnimKvq2ES6u84Axvbo_BQg@mail.gmail.com>
Date:   Wed, 22 Nov 2017 12:54:49 -0800
From:   Kees Cook <keescook@...gle.com>
To:     Rodrigo Vivi <rodrigo.vivi@...el.com>
Cc:     Mika Kahola <mika.kahola@...el.com>,
        intel-gfx@...ts.freedesktop.org,
        LKML <linux-kernel@...r.kernel.org>
Subject: i915: enum intel_dpll_id cast

Hi,

While doing Clang test builds, this was reported:

drivers/gpu/drm/i915/intel_ddi.c:1481:30: warning: implicit conversion
from enumeration type 'enum port' to different enumeration type 'enum
intel_dpll_id' [-Wenum-conversion]
        enum intel_dpll_id pll_id = port;
                           ~~~~~~   ^~~~

Which is from:

static void bxt_ddi_clock_get(struct intel_encoder *encoder,
                                struct intel_crtc_state *pipe_config)
{
        struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
        enum port port = intel_ddi_get_encoder_port(encoder);
        enum intel_dpll_id pll_id = port;

        pipe_config->port_clock = bxt_calc_pll_link(dev_priv, pll_id);
...
}

In looking at it, it seems to be harmless if as enum port has a
smaller range than enum intel_dpll_id. I just wanted to check if maybe
something might go weird, since DPLL_ID_LCPLL_2700 maybe ends up
getting seen as I915_MAX_PORTS?

enum port {
        PORT_NONE = -1,
        PORT_A = 0,
        PORT_B,
        PORT_C,
        PORT_D,
        PORT_E,
        I915_MAX_PORTS
};

enum intel_dpll_id {
...
        DPLL_ID_LCPLL_2700 = 5,
...
};


Thanks!

-Kees

-- 
Kees Cook
Pixel Security

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ