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 E57D1C433E2 for ; Sun, 19 Jul 2020 10:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C382120734 for ; Sun, 19 Jul 2020 10:24:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726543AbgGSKYB (ORCPT ); Sun, 19 Jul 2020 06:24:01 -0400 Received: from asavdk4.altibox.net ([109.247.116.15]:52098 "EHLO asavdk4.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725836AbgGSKYB (ORCPT ); Sun, 19 Jul 2020 06:24:01 -0400 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 Cc: David Airlie , Daniel Vetter , od@zcrc.me, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org 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-Type: text/plain; charset=us-ascii 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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