From: Daniel Vetter <daniel@ffwll.ch>
To: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Silence compiler warning
Date: Fri, 29 May 2015 19:06:33 +0200 [thread overview]
Message-ID: <20150529170633.GO8341@phenom.ffwll.local> (raw)
In-Reply-To: <1432898889-7508-1-git-send-email-ander.conselvan.de.oliveira@intel.com>
On Fri, May 29, 2015 at 02:28:09PM +0300, Ander Conselvan de Oliveira wrote:
> Silence the following -Wmaybe-uninitialized warnings and make the code
> more clear.
>
> drivers/gpu/drm/i915/intel_display.c: In function ‘__intel_set_mode’:
> drivers/gpu/drm/i915/intel_display.c:11844:14: warning: ‘crtc_state’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> return state->mode_changed || state->active_changed;
> ^
> drivers/gpu/drm/i915/intel_display.c:11854:25: note: ‘crtc_state’ was declared here
> struct drm_crtc_state *crtc_state;
> ^
> drivers/gpu/drm/i915/intel_display.c:11868:6: warning: ‘crtc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> if (crtc != intel_encoder->base.crtc)
> ^
> drivers/gpu/drm/i915/intel_display.c:11853:19: note: ‘crtc’ was declared here
> struct drm_crtc *crtc;
>
> Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Queued for -next, thanks for the patch.
-Daniel
> ---
> drivers/gpu/drm/i915/intel_display.c | 42 ++++++++++++++++++------------------
> 1 file changed, 21 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index c392e58..ee3adb3 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11861,15 +11861,15 @@ intel_modeset_update_state(struct drm_atomic_state *state)
> if (!intel_encoder->base.crtc)
> continue;
>
> - for_each_crtc_in_state(state, crtc, crtc_state, i)
> - if (crtc == intel_encoder->base.crtc)
> - break;
> + for_each_crtc_in_state(state, crtc, crtc_state, i) {
> + if (crtc != intel_encoder->base.crtc)
> + continue;
>
> - if (crtc != intel_encoder->base.crtc)
> - continue;
> + if (crtc_state->enable && needs_modeset(crtc_state))
> + intel_encoder->connectors_active = false;
>
> - if (crtc_state->enable && needs_modeset(crtc_state))
> - intel_encoder->connectors_active = false;
> + break;
> + }
> }
>
> drm_atomic_helper_swap_state(state->dev, state);
> @@ -11884,24 +11884,24 @@ intel_modeset_update_state(struct drm_atomic_state *state)
> if (!connector->encoder || !connector->encoder->crtc)
> continue;
>
> - for_each_crtc_in_state(state, crtc, crtc_state, i)
> - if (crtc == connector->encoder->crtc)
> - break;
> + for_each_crtc_in_state(state, crtc, crtc_state, i) {
> + if (crtc != connector->encoder->crtc)
> + continue;
>
> - if (crtc != connector->encoder->crtc)
> - continue;
> + if (crtc->state->enable && needs_modeset(crtc->state)) {
> + struct drm_property *dpms_property =
> + dev->mode_config.dpms_property;
>
> - if (crtc->state->enable && needs_modeset(crtc->state)) {
> - struct drm_property *dpms_property =
> - dev->mode_config.dpms_property;
> + connector->dpms = DRM_MODE_DPMS_ON;
> + drm_object_property_set_value(&connector->base,
> + dpms_property,
> + DRM_MODE_DPMS_ON);
>
> - connector->dpms = DRM_MODE_DPMS_ON;
> - drm_object_property_set_value(&connector->base,
> - dpms_property,
> - DRM_MODE_DPMS_ON);
> + intel_encoder = to_intel_encoder(connector->encoder);
> + intel_encoder->connectors_active = true;
> + }
>
> - intel_encoder = to_intel_encoder(connector->encoder);
> - intel_encoder->connectors_active = true;
> + break;
> }
> }
>
> --
> 2.1.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-05-29 17:04 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-21 14:12 [PATCH 00/35] Make legacy modeset a lot more atomic-like Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 01/35] drm/i915: Remove implicitly disabling primary plane for now Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 02/35] drm/i915: Add a way to disable planes without updating state Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 03/35] drm/i915: Use the disable callback for disabling planes Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 04/35] drm/i915: get rid of primary_enabled and use atomic state Ander Conselvan de Oliveira
2015-05-07 7:43 ` Daniel Vetter
2015-04-21 14:12 ` [PATCH 05/35] drm/i915: Move intel_(pre_disable/post_enable)_primary to intel_display.c, and use it there Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 06/35] drm/i915: Rename intel_crtc_dpms_overlay Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 07/35] drm/i915: Move toggling planes out of crtc enable/disable Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 08/35] drm/i915: Don't check for NULL before freeing state Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 09/35] drm/i915: Call drm helpers when duplicating crtc and plane states Ander Conselvan de Oliveira
2015-04-21 14:12 ` [PATCH 10/35] drm/i915: Use for_each_connector_in_state helper macro Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 11/35] drm/i915: Extract mode_changed computation out of stage_output_config() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 12/35] drm/i915: Add crtc states before calling compute_config() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 13/35] drm/i915: Don't pretend we can calculate multiple pipe_configs Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 14/35] drm/i915: Calculate a new pipe_config based on new enabled state Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 15/35] drm/i915: Remove all *_pipes flags from modeset Ander Conselvan de Oliveira
2015-05-28 16:35 ` Chris Wilson
2015-05-29 11:28 ` [PATCH] drm/i915: Silence compiler warning Ander Conselvan de Oliveira
2015-05-29 17:06 ` Daniel Vetter [this message]
2015-04-21 14:13 ` [PATCH 16/35] drm/i915: Remove saved_mode from __intel_set_mode() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 17/35] drm/i915: Move compute part of __intel_set_mode() to separate function Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 18/35] drm/i915: Simplify error handling in __intel_set_mode() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 19/35] drm/i915: Don't modeset with old mode when set_crtc fails Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 20/35] drm/i915: Add primary plane to atomic state in legacy modeset Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 21/35] drm/i915: Delete fb, x and y parameters from mode set functions Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 22/35] drm/i915: Don't use struct intel_set_config *_changed flags Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 23/35] drm/i915: Don't use staged config to calculate mode_changed flags Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 24/35] drm/i915: Unify modeset and flip paths of intel_crtc_set_config() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 25/35] drm/i915: Simplify intel_set_config_compute_mode_changes() a bit Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 26/35] drm/i915: Stage new modeset state straight into atomic state Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 27/35] drm/i915: Remove save/restore logic from intel_crtc_set_config() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 28/35] drm/i915: Update crtc state active flag based on DPMS Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 29/35] drm/atomic: Make mode_fixup() optional for check_modeset() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 30/35] drm/i915: Use atomic helpers for computing changed flags Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 31/35] drm/i915: Take ownership of atomic state on success in intel_set_mode() Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 32/35] drm/i915: Preserve shared DPLL information in new pipe_config Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 33/35] drm/i915: Don't use plane update helper in legacy mode set Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 34/35] drm/i915: Swap atomic state in legacy modeset Ander Conselvan de Oliveira
2015-04-21 14:13 ` [PATCH 35/35] drm/i915: Get rid of intel_crtc_set_state() Ander Conselvan de Oliveira
2015-04-21 15:21 ` [PATCH 00/35] Make legacy modeset a lot more atomic-like Maarten Lankhorst
2015-05-07 8:16 ` Daniel Vetter
[not found] <1389146191-2096-1-git-send-email-ying.xue@windriver.com>
2014-01-08 7:35 ` [PATCH] drm/i915: silence compiler warning Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150529170633.GO8341@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=ander.conselvan.de.oliveira@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox