From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21D11C433DF for ; Sun, 19 Jul 2020 10:24:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F022D20734 for ; Sun, 19 Jul 2020 10:24:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F022D20734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 39C9F6E060; Sun, 19 Jul 2020 10:24:01 +0000 (UTC) Received: from asavdk4.altibox.net (asavdk4.altibox.net [109.247.116.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 807576E060 for ; Sun, 19 Jul 2020 10:24:00 +0000 (UTC) Received: from ravnborg.org (unknown [188.228.123.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk4.altibox.net (Postfix) with ESMTPS id 2772C8051D; Sun, 19 Jul 2020 12:23:56 +0200 (CEST) Date: Sun, 19 Jul 2020 12:23:54 +0200 From: Sam Ravnborg To: Paul Cercueil Subject: Re: [PATCH] drm/ingenic: Silence uninitialized-variable warning Message-ID: <20200719102354.GA20692@ravnborg.org> References: <20200719093834.14084-1-paul@crapouillou.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200719093834.14084-1-paul@crapouillou.net> X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=aP3eV41m c=1 sm=1 tr=0 a=S6zTFyMACwkrwXSdXUNehg==:117 a=S6zTFyMACwkrwXSdXUNehg==:17 a=kj9zAlcOel0A:10 a=ER_8r6IbAAAA:8 a=7gkXJVJtAAAA:8 a=xnlXP8Hkb89yI6koaScA:9 a=+jEqtf1s3R9VXZ0wqowq2kgwd+I=:19 a=CjuIK1q_8ugA:10 a=9LHmKk7ezEChjTCyhBa9:22 a=E9Po1WZjFZOl8hwRPBS3:22 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , od@zcrc.me, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Patch looks good. Had to dig into the code to understand the change to the no_vblank flag. So: Reviewed-by: Sam Ravnborg 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel