[PULL] drm-intel-next-fixes
diff mbox

Message ID 20150619152426.GA25769@phenom.ffwll.local
State New
Headers show

Commit Message

Daniel Vetter June 19, 2015, 3:24 p.m. UTC
On Fri, Jun 19, 2015 at 01:48:13PM +1000, Dave Airlie wrote:
> On 18 June 2015 at 16:04, Jani Nikula <jani.nikula@intel.com> wrote:
> >
> > Hi Dave, i915 fixes for drm-next/v4.2.
> >
> > BR,
> > Jani.
> 
> And my gcc says:
> 
> /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:
> In function ‘__intel_set_mode’:
> /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11850:14:
> warning: ‘crtc_state’ may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>   return state->mode_changed || state->active_changed;
>               ^
> /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11860:25:
> note: ‘crtc_state’ was declared here
>   struct drm_crtc_state *crtc_state;
>                          ^
> /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11874:6:
> warning: ‘crtc’ may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>    if (crtc != intel_encoder->base.crtc)
>       ^
> /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11859:19:
> note: ‘crtc’ was declared here
>   struct drm_crtc *crtc;
>                    ^
> 
> No idea if this is true, but I don't think I've seen it before now.
> 
> gcc 5.1.1 on fedora 22

Yeah this is new with Ander's patches. gcc Doesn't know that we have at
least 1 crtc and hence crtc&crtc are guaranteed to be initiliazed. I
think you should be able to shut it up with

But the entire Finland team is out of office (celebrating solstice), so
might be better to wait for Monday for them to confirm. Otherwise just
apply this fixup with my ack if you want to send out the merge window pull
asap.

Cheers, Daniel

Comments

Ander Conselvan de Oliveira June 22, 2015, 7:59 a.m. UTC | #1
There is

commit bd4b4827acdc00bf9e71f939d160102021d10d4f
Author: Ander Conselvan de Oliveira
<ander.conselvan.de.oliveira@intel.com>
Date:   Fri May 29 14:28:09 2015 +0300

    drm/i915: Silence compiler warning

in -nightly to fix that same issue. I didn't realize this was also
needed in -next-fixes.


Ander

On Fri, 2015-06-19 at 17:24 +0200, Daniel Vetter wrote:
> On Fri, Jun 19, 2015 at 01:48:13PM +1000, Dave Airlie wrote:
> > On 18 June 2015 at 16:04, Jani Nikula <jani.nikula@intel.com> wrote:
> > >
> > > Hi Dave, i915 fixes for drm-next/v4.2.
> > >
> > > BR,
> > > Jani.
> > 
> > And my gcc says:
> > 
> > /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:
> > In function ‘__intel_set_mode’:
> > /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11850:14:
> > warning: ‘crtc_state’ may be used uninitialized in this function
> > [-Wmaybe-uninitialized]
> >   return state->mode_changed || state->active_changed;
> >               ^
> > /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11860:25:
> > note: ‘crtc_state’ was declared here
> >   struct drm_crtc_state *crtc_state;
> >                          ^
> > /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11874:6:
> > warning: ‘crtc’ may be used uninitialized in this function
> > [-Wmaybe-uninitialized]
> >    if (crtc != intel_encoder->base.crtc)
> >       ^
> > /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11859:19:
> > note: ‘crtc’ was declared here
> >   struct drm_crtc *crtc;
> >                    ^
> > 
> > No idea if this is true, but I don't think I've seen it before now.
> > 
> > gcc 5.1.1 on fedora 22
> 
> Yeah this is new with Ander's patches. gcc Doesn't know that we have at
> least 1 crtc and hence crtc&crtc are guaranteed to be initiliazed. I
> think you should be able to shut it up with
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index e047105837c9..5ade250dc6d7 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11856,8 +11856,8 @@ intel_modeset_update_state(struct drm_atomic_state *state)
>  	struct drm_device *dev = state->dev;
>  	struct drm_i915_private *dev_priv = dev->dev_private;
>  	struct intel_encoder *intel_encoder;
> -	struct drm_crtc *crtc;
> -	struct drm_crtc_state *crtc_state;
> +	struct drm_crtc *crtc = NULL;
> +	struct drm_crtc_state *crtc_state = NULL;
>  	struct drm_connector *connector;
>  	int i;
>  
> But the entire Finland team is out of office (celebrating solstice), so
> might be better to wait for Monday for them to confirm. Otherwise just
> apply this fixup with my ack if you want to send out the merge window pull
> asap.
> 
> Cheers, Daniel
Jani Nikula June 22, 2015, 8:12 a.m. UTC | #2
On Mon, 22 Jun 2015, Ander Conselvan De Oliveira <conselvan2@gmail.com> wrote:
> There is
>
> commit bd4b4827acdc00bf9e71f939d160102021d10d4f
> Author: Ander Conselvan de Oliveira
> <ander.conselvan.de.oliveira@intel.com>
> Date:   Fri May 29 14:28:09 2015 +0300
>
>     drm/i915: Silence compiler warning
>
> in -nightly to fix that same issue. I didn't realize this was also
> needed in -next-fixes.

Dave, sorry, I didn't see the warning, gcc 4.9.2 here.

Do you want another pull request with Ander's fix on top?

BR,
Jani.


>
>
> Ander
>
> On Fri, 2015-06-19 at 17:24 +0200, Daniel Vetter wrote:
>> On Fri, Jun 19, 2015 at 01:48:13PM +1000, Dave Airlie wrote:
>> > On 18 June 2015 at 16:04, Jani Nikula <jani.nikula@intel.com> wrote:
>> > >
>> > > Hi Dave, i915 fixes for drm-next/v4.2.
>> > >
>> > > BR,
>> > > Jani.
>> > 
>> > And my gcc says:
>> > 
>> > /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:
>> > In function ‘__intel_set_mode’:
>> > /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11850:14:
>> > warning: ‘crtc_state’ may be used uninitialized in this function
>> > [-Wmaybe-uninitialized]
>> >   return state->mode_changed || state->active_changed;
>> >               ^
>> > /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11860:25:
>> > note: ‘crtc_state’ was declared here
>> >   struct drm_crtc_state *crtc_state;
>> >                          ^
>> > /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11874:6:
>> > warning: ‘crtc’ may be used uninitialized in this function
>> > [-Wmaybe-uninitialized]
>> >    if (crtc != intel_encoder->base.crtc)
>> >       ^
>> > /home/airlied/devel/kernel/drm-next/drivers/gpu/drm/i915/intel_display.c:11859:19:
>> > note: ‘crtc’ was declared here
>> >   struct drm_crtc *crtc;
>> >                    ^
>> > 
>> > No idea if this is true, but I don't think I've seen it before now.
>> > 
>> > gcc 5.1.1 on fedora 22
>> 
>> Yeah this is new with Ander's patches. gcc Doesn't know that we have at
>> least 1 crtc and hence crtc&crtc are guaranteed to be initiliazed. I
>> think you should be able to shut it up with
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index e047105837c9..5ade250dc6d7 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -11856,8 +11856,8 @@ intel_modeset_update_state(struct drm_atomic_state *state)
>>  	struct drm_device *dev = state->dev;
>>  	struct drm_i915_private *dev_priv = dev->dev_private;
>>  	struct intel_encoder *intel_encoder;
>> -	struct drm_crtc *crtc;
>> -	struct drm_crtc_state *crtc_state;
>> +	struct drm_crtc *crtc = NULL;
>> +	struct drm_crtc_state *crtc_state = NULL;
>>  	struct drm_connector *connector;
>>  	int i;
>>  
>> But the entire Finland team is out of office (celebrating solstice), so
>> might be better to wait for Monday for them to confirm. Otherwise just
>> apply this fixup with my ack if you want to send out the merge window pull
>> asap.
>> 
>> Cheers, Daniel
>
>
Dave Airlie June 22, 2015, 8:13 a.m. UTC | #3
On 22 June 2015 at 18:12, Jani Nikula <jani.nikula@intel.com> wrote:
> On Mon, 22 Jun 2015, Ander Conselvan De Oliveira <conselvan2@gmail.com> wrote:
>> There is
>>
>> commit bd4b4827acdc00bf9e71f939d160102021d10d4f
>> Author: Ander Conselvan de Oliveira
>> <ander.conselvan.de.oliveira@intel.com>
>> Date:   Fri May 29 14:28:09 2015 +0300
>>
>>     drm/i915: Silence compiler warning
>>
>> in -nightly to fix that same issue. I didn't realize this was also
>> needed in -next-fixes.
>
> Dave, sorry, I didn't see the warning, gcc 4.9.2 here.
>
> Do you want another pull request with Ander's fix on top?

Yes please.

Dave.

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e047105837c9..5ade250dc6d7 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11856,8 +11856,8 @@  intel_modeset_update_state(struct drm_atomic_state *state)
 	struct drm_device *dev = state->dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct intel_encoder *intel_encoder;
-	struct drm_crtc *crtc;
-	struct drm_crtc_state *crtc_state;
+	struct drm_crtc *crtc = NULL;
+	struct drm_crtc_state *crtc_state = NULL;
 	struct drm_connector *connector;
 	int i;