From patchwork Fri Nov 30 16:05:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 1006054 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sR6xxP4q"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="IYtMXcvP"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 435zkl2fvgz9s8r for ; Sat, 1 Dec 2018 03:05:35 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jkECi9u6NdN93kTQzw4lJgW8CzJZk5RRyHcAnFIPCdA=; b=sR6xxP4qMS3lFi Y1lBJitVtvTve38occq81Ng43n2lCtaczzjyzPtyXFzPPRmqMeCv0/m2KAAEyXd+znQclXSfVLKws lu8HRhea1I9bvLOKMG/d9gcFF6adpg4jvQXHJtvvEaE6y8YR+QREcaxrVlHSrdUzEsJN9juGpVw9R AAPOCRHqgDBogEsan6zujGLBAJQxhKaRNezM7ZeqhtJWyFeE+iLzoOwm4Fciu6o7pR+HZkQaYfSAW 3ofPMfz37ZD/a6/G1hSMdSFz9vv+59zjZYhKVhBxnczmn0aOir8AH2raT2qDGDzk99j3nQFVKTAZJ dExyXnrU3jUR/iaSaA9Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSlIH-0005Vl-HD; Fri, 30 Nov 2018 16:05:29 +0000 Received: from mail-lj1-x243.google.com ([2a00:1450:4864:20::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSlIE-0005UU-3k for linux-arm-kernel@lists.infradead.org; Fri, 30 Nov 2018 16:05:27 +0000 Received: by mail-lj1-x243.google.com with SMTP id v15-v6so5420850ljh.13 for ; Fri, 30 Nov 2018 08:05:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1Q6OpVlKGi2rNqRFLuocPd3nAs+AvtLdb1mSVpc1EnA=; b=IYtMXcvPk8+BDvFq2Q2tdfg9Rwd44S3kfp4mU1Z7O5P4HmDpKH50HnwftrxRChC9gr mcU1/XKs8lU+B9cy8BpheN343aEDbGBg/tacXx6uGRLOseXTUuY0b7lYcS0Fx+gVGlwL d/cW/S16Pw9BcKsfNY65nlIt7i8S53wbk7zoA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1Q6OpVlKGi2rNqRFLuocPd3nAs+AvtLdb1mSVpc1EnA=; b=nyRoiLir62UBB1Bg4o2vG89A2JUcdaCgtlVm6QuHZ4iPPyVn78eEk7/0JiGHh2/ppm MvOpK/cpTHcGt+4xalUY24S7ah1u09yyOU0DYCEJ17P877vLrjkm4vrr+LR9LtFnnwBe +fvUxEpXpaKR9D5nt8sW6H9T7Jv9gVDL2qXZp449iWLIOJ2gJi+dV9rDligjwiJ782km cWpIjYnNCtjBd2ienq7RUTcRzIJc/WioX4VLxFbatg1ZJz6PWjwpuTiEj7JMAEGwkRN5 f9AiXLTiiexXAtbJ5fdP2jJOxgC9LveHw5NpeWxOFdekae1zK/2jyV6rrB82VNJaAJGN yzTQ== X-Gm-Message-State: AA+aEWb0eWlSsD/rc1JNX5RiOx+tTBOEOcyX4MIaRsjVFG3WKjPBJrFT jTQNOMmUa8s/HTqDaMalPShfYwnc8zmUMg== X-Google-Smtp-Source: AFSGD/X6Lm1WS5hC8lqISP4G+FznzWxMvIBnP2h2EOCLz3/i4IaSqq3+7YUOt1dFf9VbYgX8c4dB4Q== X-Received: by 2002:a2e:5418:: with SMTP id i24-v6mr4603769ljb.51.1543593913761; Fri, 30 Nov 2018 08:05:13 -0800 (PST) Received: from localhost (c-732171d5.07-21-73746f28.bbcust.telenor.se. [213.113.33.115]) by smtp.gmail.com with ESMTPSA id d82sm889847lfd.82.2018.11.30.08.05.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Nov 2018 08:05:13 -0800 (PST) From: Anders Roxell To: airlied@linux.ie, wens@csie.org Subject: [PATCH] drm/sun4i: tcon: fix false-positive uninitialized build warning Date: Fri, 30 Nov 2018 17:05:08 +0100 Message-Id: <20181130160508.28230-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181130_080526_152826_78336AB4 X-CRM114-Status: GOOD ( 14.89 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Anders Roxell , linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org With GCC version 5 and 6, this uninitialized warning can be seen. GCC have been fixed in newer versions. drivers/gpu/drm/sun4i/sun4i_tcon.c: In function ‘sun4i_tcon_bind’: drivers/gpu/drm/sun4i/sun4i_tcon.c:1091:21: warning: ‘has_lvds_alt’ may be used uninitialized in this function [-Wmaybe-uninitialized] bool has_lvds_rst, has_lvds_alt, can_lvds; ^~~~~~~~~~~~ Reworked the code so it covers that false positive also. Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Signed-off-by: Anders Roxell --- drivers/gpu/drm/sun4i/sun4i_tcon.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c index 0420f5c978b9..317d4fa3429c 100644 --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c @@ -1161,20 +1161,20 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, */ if (tcon->quirks->has_lvds_alt) { tcon->lvds_pll = devm_clk_get(dev, "lvds-alt"); - if (IS_ERR(tcon->lvds_pll)) { - if (PTR_ERR(tcon->lvds_pll) == -ENOENT) { - has_lvds_alt = false; - } else { - dev_err(dev, "Couldn't get the LVDS PLL\n"); - return PTR_ERR(tcon->lvds_pll); - } + ret = PTR_ERR_OR_ZERO(tcon->lvds_pll); + if (ret == -ENOENT) { + has_lvds_alt = false; + } else if (ret) { + dev_err(dev, "Couldn't get the LVDS PLL\n"); + return ret; } else { has_lvds_alt = true; } + } else { + has_lvds_alt = false; } - if (!has_lvds_rst || - (tcon->quirks->has_lvds_alt && !has_lvds_alt)) { + if (!has_lvds_rst || !has_lvds_alt) { dev_warn(dev, "Missing LVDS properties, Please upgrade your DT\n"); dev_warn(dev, "LVDS output disabled\n"); can_lvds = false;