[v2] drm/i915: Avoid enum conversion warning
diff mbox series

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

Commit Message

Nick Desaulniers Nov. 27, 2017, 3:49 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;
                           ~~~~~~   ^~~~

Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel Vetter Nov. 27, 2017, 10:21 a.m. UTC | #1
On Sun, Nov 26, 2017 at 07:49:14PM -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;
>                            ~~~~~~   ^~~~
> 
> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>

This doesn't apply on latest drm-intel.git code anymore, we removed this.
Thanks anyway.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 933c18fd4258..3c346c8cbf78 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1477,8 +1477,8 @@ 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;
> +	enum intel_dpll_id pll_id =
> +		(enum intel_dpll_id)intel_ddi_get_encoder_port(encoder);
>  
>  	pipe_config->port_clock = bxt_calc_pll_link(dev_priv, pll_id);
>  
> -- 
> 2.14.1
>

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 933c18fd4258..3c346c8cbf78 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1477,8 +1477,8 @@  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;
+	enum intel_dpll_id pll_id =
+		(enum intel_dpll_id)intel_ddi_get_encoder_port(encoder);
 
 	pipe_config->port_clock = bxt_calc_pll_link(dev_priv, pll_id);