diff mbox

[4/5] drm/i915: remove unused variables from ironlake_crtc_mode_set

Message ID 1348176967-4323-5-git-send-email-przanoni@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paulo Zanoni Sept. 20, 2012, 9:36 p.m. UTC
From: Paulo Zanoni <paulo.r.zanoni@intel.com>

The last patches moved a lot of code from ironlake_crtc_mode_set to
sub-functions, so these variables became useless. You could get
warnings by enabling -Wunused-but-set-variable.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |   21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

Comments

Rodrigo Vivi Sept. 24, 2012, 11:36 p.m. UTC | #1
Feel free to use
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>

On Thu, Sep 20, 2012 at 6:36 PM, Paulo Zanoni <przanoni@gmail.com> wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> The last patches moved a lot of code from ironlake_crtc_mode_set to
> sub-functions, so these variables became useless. You could get
> warnings by enabling -Wunused-but-set-variable.
>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c |   21 +++------------------
>  1 file changed, 3 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 5fb082f..c402774 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -4898,39 +4898,24 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
>         int num_connectors = 0;
>         intel_clock_t clock, reduced_clock;
>         u32 dpll, fp = 0, fp2 = 0;
> -       bool ok, has_reduced_clock = false, is_sdvo = false;
> -       bool is_crt = false, is_lvds = false, is_tv = false, is_dp = false;
> +       bool ok, has_reduced_clock = false;
> +       bool is_lvds = false, is_dp = false, is_cpu_edp = false;
>         struct intel_encoder *encoder;
>         u32 temp;
>         int ret;
>         bool dither;
> -       bool is_cpu_edp = false, is_pch_edp = false;
>
>         for_each_encoder_on_crtc(dev, crtc, encoder) {
>                 switch (encoder->type) {
>                 case INTEL_OUTPUT_LVDS:
>                         is_lvds = true;
>                         break;
> -               case INTEL_OUTPUT_SDVO:
> -               case INTEL_OUTPUT_HDMI:
> -                       is_sdvo = true;
> -                       if (encoder->needs_tv_clock)
> -                               is_tv = true;
> -                       break;
> -               case INTEL_OUTPUT_TVOUT:
> -                       is_tv = true;
> -                       break;
> -               case INTEL_OUTPUT_ANALOG:
> -                       is_crt = true;
> -                       break;
>                 case INTEL_OUTPUT_DISPLAYPORT:
>                         is_dp = true;
>                         break;
>                 case INTEL_OUTPUT_EDP:
>                         is_dp = true;
> -                       if (intel_encoder_is_pch_edp(&encoder->base))
> -                               is_pch_edp = true;
> -                       else
> +                       if (!intel_encoder_is_pch_edp(&encoder->base))
>                                 is_cpu_edp = true;
>                         break;
>                 }
> --
> 1.7.10.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter Sept. 25, 2012, 8:44 a.m. UTC | #2
On Mon, Sep 24, 2012 at 08:36:27PM -0300, Rodrigo Vivi wrote:
> Feel free to use
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>

Merged up to this patch to dinq, thanks for the review&patches.
-Daniel
> 
> On Thu, Sep 20, 2012 at 6:36 PM, Paulo Zanoni <przanoni@gmail.com> wrote:
> > From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> >
> > The last patches moved a lot of code from ironlake_crtc_mode_set to
> > sub-functions, so these variables became useless. You could get
> > warnings by enabling -Wunused-but-set-variable.
> >
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c |   21 +++------------------
> >  1 file changed, 3 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 5fb082f..c402774 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -4898,39 +4898,24 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
> >         int num_connectors = 0;
> >         intel_clock_t clock, reduced_clock;
> >         u32 dpll, fp = 0, fp2 = 0;
> > -       bool ok, has_reduced_clock = false, is_sdvo = false;
> > -       bool is_crt = false, is_lvds = false, is_tv = false, is_dp = false;
> > +       bool ok, has_reduced_clock = false;
> > +       bool is_lvds = false, is_dp = false, is_cpu_edp = false;
> >         struct intel_encoder *encoder;
> >         u32 temp;
> >         int ret;
> >         bool dither;
> > -       bool is_cpu_edp = false, is_pch_edp = false;
> >
> >         for_each_encoder_on_crtc(dev, crtc, encoder) {
> >                 switch (encoder->type) {
> >                 case INTEL_OUTPUT_LVDS:
> >                         is_lvds = true;
> >                         break;
> > -               case INTEL_OUTPUT_SDVO:
> > -               case INTEL_OUTPUT_HDMI:
> > -                       is_sdvo = true;
> > -                       if (encoder->needs_tv_clock)
> > -                               is_tv = true;
> > -                       break;
> > -               case INTEL_OUTPUT_TVOUT:
> > -                       is_tv = true;
> > -                       break;
> > -               case INTEL_OUTPUT_ANALOG:
> > -                       is_crt = true;
> > -                       break;
> >                 case INTEL_OUTPUT_DISPLAYPORT:
> >                         is_dp = true;
> >                         break;
> >                 case INTEL_OUTPUT_EDP:
> >                         is_dp = true;
> > -                       if (intel_encoder_is_pch_edp(&encoder->base))
> > -                               is_pch_edp = true;
> > -                       else
> > +                       if (!intel_encoder_is_pch_edp(&encoder->base))
> >                                 is_cpu_edp = true;
> >                         break;
> >                 }
> > --
> > 1.7.10.4
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> 
> 
> -- 
> Rodrigo Vivi
> Blog: http://blog.vivi.eng.br
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5fb082f..c402774 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4898,39 +4898,24 @@  static int ironlake_crtc_mode_set(struct drm_crtc *crtc,
 	int num_connectors = 0;
 	intel_clock_t clock, reduced_clock;
 	u32 dpll, fp = 0, fp2 = 0;
-	bool ok, has_reduced_clock = false, is_sdvo = false;
-	bool is_crt = false, is_lvds = false, is_tv = false, is_dp = false;
+	bool ok, has_reduced_clock = false;
+	bool is_lvds = false, is_dp = false, is_cpu_edp = false;
 	struct intel_encoder *encoder;
 	u32 temp;
 	int ret;
 	bool dither;
-	bool is_cpu_edp = false, is_pch_edp = false;
 
 	for_each_encoder_on_crtc(dev, crtc, encoder) {
 		switch (encoder->type) {
 		case INTEL_OUTPUT_LVDS:
 			is_lvds = true;
 			break;
-		case INTEL_OUTPUT_SDVO:
-		case INTEL_OUTPUT_HDMI:
-			is_sdvo = true;
-			if (encoder->needs_tv_clock)
-				is_tv = true;
-			break;
-		case INTEL_OUTPUT_TVOUT:
-			is_tv = true;
-			break;
-		case INTEL_OUTPUT_ANALOG:
-			is_crt = true;
-			break;
 		case INTEL_OUTPUT_DISPLAYPORT:
 			is_dp = true;
 			break;
 		case INTEL_OUTPUT_EDP:
 			is_dp = true;
-			if (intel_encoder_is_pch_edp(&encoder->base))
-				is_pch_edp = true;
-			else
+			if (!intel_encoder_is_pch_edp(&encoder->base))
 				is_cpu_edp = true;
 			break;
 		}