public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Paul Cercueil <paul@crapouillou.net>
Cc: David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	od@zcrc.me, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/ingenic: Silence uninitialized-variable warning
Date: Sun, 19 Jul 2020 12:23:54 +0200	[thread overview]
Message-ID: <20200719102354.GA20692@ravnborg.org> (raw)
In-Reply-To: <20200719093834.14084-1-paul@crapouillou.net>

Hi Paul.

On Sun, Jul 19, 2020 at 11:38:34AM +0200, Paul Cercueil wrote:
> 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.
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Patch looks good. Had to dig into the code to understand the
change to the no_vblank flag.
So:
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

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

> ---
>  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.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> index b6d946fbeaf5..ada990a7f911 100644
> --- 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(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;
> -- 
> 2.27.0

  reply	other threads:[~2020-07-19 10:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-19  9:38 [PATCH] drm/ingenic: Silence uninitialized-variable warning Paul Cercueil
2020-07-19 10:23 ` Sam Ravnborg [this message]
2020-07-19 11:08   ` Paul Cercueil

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=20200719102354.GA20692@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=od@zcrc.me \
    --cc=paul@crapouillou.net \
    /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