drm/i915: Avoid enum conversion warning
diff mbox series

Message ID 20171123075048.15882-1-nick.desaulniers@gmail.com
State New, archived
Headers show
Series
  • drm/i915: Avoid enum conversion warning
Related show

Commit Message

Nick Desaulniers Nov. 23, 2017, 7:50 a.m. UTC
Fixes the following enum conversion warning:

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

Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Vetter Nov. 23, 2017, 7:59 a.m. UTC | #1
On Wed, Nov 22, 2017 at 11:50:48PM -0800, Nick Desaulniers wrote:
> Fixes the following enum conversion warning:
> 
> drivers/gpu/drm/i915/intel_ddi.c:1481:30: error: implicit conversion
> from enumeration type 'enum port' to different enumeration type 'enum
> intel_dpll_id' [-Werror,-Wenum-conversion]
>         enum intel_dpll_id pll_id = port;
>                            ~~~~~~   ^~~~
> 
> Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 933c18fd4258..f9de45316901 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1478,7 +1478,7 @@ static void bxt_ddi_clock_get(struct intel_encoder *encoder,
>  {
>  	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;
> +	uint32_t pll_id = port;

Please do a cast instead of dropping the dpll enum annotation. Just
shutting up compilers doesn't really help anyone.
-Daniel
>  
>  	pipe_config->port_clock = bxt_calc_pll_link(dev_priv, pll_id);
>  
> -- 
> 2.14.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 933c18fd4258..f9de45316901 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1478,7 +1478,7 @@  static void bxt_ddi_clock_get(struct intel_encoder *encoder,
 {
 	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;
+	uint32_t pll_id = port;
 
 	pipe_config->port_clock = bxt_calc_pll_link(dev_priv, pll_id);