drm/ingenic: Silence uninitialized-variable warning
Subsystems (3)
Paul Cercueil
maintainerPATCH 1/1 drm/ingenic: Silence uninitialized-variable warning
Silence compiler warning about used but uninitialized 'ipu_state' variable. In practice, the variable would never be used when uninitialized, but the compiler cannot know that 'priv->ipu_plane' will always be NULL if CONFIG_INGENIC_IPU is disabled.
Silence the warning by initializing the value to NULL.
--- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +2 -2
@@ -198,7 +198,7 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) {struct ingenic_drm *priv =drm_crtc_get_priv (crtc); -struct drm_plane_state *f1_state, *f0_state, *ipu_state; +struct drm_plane_state *f1_state, *f0_state, *ipu_state =NULL ;long rate;if (!drm_atomic_crtc_needs_modeset (state))
@@ -229,7 +229,7 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc *crtc,/* If all the planes are disabled, we won't get a VBLANK IRQ */ priv->no_vblank = !f1_state->fb && !f0_state->fb && - !(priv->ipu_plane && ipu_state->fb); + !(ipu_state && ipu_state->fb); }return 0 ;
Signature · 1 line
2.27.0
Hi Paul.
Quoted 8 lines · Paul Cercueil
Silence compiler warning about used but uninitialized '
ipu_state' variable. In practice, the variable would never be used when uninitialized, but the compiler cannot know that 'priv->ipu_plane' will always be NULL ifCONFIG_INGENIC_IPUis disabled.Silence the warning by initializing the value to NULL.
Signed-off-by Paul Cercueil <[email protected]>
Patch looks good. Had to dig into the code to understand the change to the no_vblank flag.
So:
I expect you to commit the patch.
Looking at the code I noticed that the return value of drm_atomic_get_plane_state() is not checked. Can you try to look into this.
Sam
Quoted 28 lines
--- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/ingenic/ingenic-drm-drv.c +2
-2@@ -198,7 +198,7 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) {struct ingenic_drm *priv =drm_crtc_get_priv (crtc); -struct drm_plane_state *f1_state, *f0_state, *ipu_state; +struct drm_plane_state *f1_state, *f0_state, *ipu_state =NULL ;long rate;if (!drm_atomic_crtc_needs_modeset (state))@@ -229,7 +229,7 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc *crtc,/* If all the planes are disabled, we won't get a VBLANK IRQ */ priv->no_vblank = !f1_state->fb && !f0_state->fb && - !(priv->ipu_plane && ipu_state->fb); + !(ipu_state && ipu_state->fb); }return 0 ;Signature · 1 line
2.27.0
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Paul Cercueil
maintainerHi Sam,
Quoted 11 lines · Sam Ravnborg
Hi Paul.
Quoted 8 lines · Paul Cercueil
Silence compiler warning about used but uninitialized '
ipu_state' variable. In practice, the variable would never be used when uninitialized, but the compiler cannot know that 'priv->ipu_plane'
will
always be NULL ifCONFIG_INGENIC_IPUis disabled.Silence the warning by initializing the value to NULL.
Quoted 7 lines
Quoted 1 line
Signed-off-by Paul Cercueil <[email protected]>Patch looks good. Had to dig into the code to understand the change to the
no_vblankflag.
So:Reviewed-by Sam Ravnborg <[email protected]>I expect you to commit the patch.
Pushed, thanks.
Quoted 3 lines
Looking at the code I noticed that the return value of
drm_atomic_get_plane_state()is not checked. Can you try to look into this.
Right. I'll fix it.
-Paul
Quoted 33 lines
Sam
Quoted 31 lines
---
drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)diff --git
a/drivers/gpu/drm/ingenic/ingenic-drm-drv.cb/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
indexb6d946fbeaf5..ada990a7f911100644
---a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -198,7 +198,7 @@ static int ingenic_drm_crtc_atomic_check(structdrm_crtc*crtc,
structdrm_crtc_state*state)
{
structingenic_drm*priv =drm_crtc_get_priv(crtc);
- structdrm_plane_state*f1_state,*f0_state,*ipu_state;
+ structdrm_plane_state*f1_state,*f0_state,*ipu_state= NULL;
long rate;if (!drm_atomic_crtc_needs_modeset(state))
@@ -229,7 +229,7 @@ static int ingenic_drm_crtc_atomic_check(structdrm_crtc*crtc,/* If all the planes are disabled, we won't get a VBLANK IRQ */
priv->no_vblank= !f1_state->fb && !f0_state->fb &&
- !(priv->ipu_plane &&ipu_state->fb);
+ !(ipu_state &&ipu_state->fb);
}return 0;
--
2.27.0