From patchwork Wed May 27 14:05:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11573081 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 249E0159A for ; Wed, 27 May 2020 14:05:51 +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 0D00E207D3 for ; Wed, 27 May 2020 14:05:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D00E207D3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de 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 F19AB899DC; Wed, 27 May 2020 14:05:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51804899DC for ; Wed, 27 May 2020 14:05:47 +0000 (UTC) Received: from threadripper.lan ([149.172.98.151]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MLiXQ-1jMHJG1tIG-00HfcC; Wed, 27 May 2020 16:05:34 +0200 From: Arnd Bergmann To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Tvrtko Ursulin , John Harrison Subject: [PATCH 2/3] drm/i915: work around false-positive maybe-uninitialized warning Date: Wed, 27 May 2020 16:05:09 +0200 Message-Id: <20200527140526.1458215-2-arnd@arndb.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200527140526.1458215-1-arnd@arndb.de> References: <20200527140526.1458215-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:XhGV89xHEat1ahk9vDcOini1cTFmNy3hR/+IomNkF0dDIF4zpZG mVIweZpVkM1y3GUbDfSqkcJna53e8KALJOgJZmp7Twzav4yEeJLd9a6aGl9MuGJqv39Lm+1 UtuYJ1CEH/1ruBsaqZOgZiXbw7k0vnL6MV+C46oN8FSuiZglkpaYnFEdXhsjxXy83Lxm7fj j/oHTDzvKdfuKAtc5lVow== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:6q9GEMSIHfE=:SltPygotEWIkp2d4ogF7Xh /11yqp6Cat0DU8un95gA2KmZtYE9HHXVtHZWdKUFy8jKARI09BnD2IaSlg+gSu+qXXjECpw8O Nmssz5cvCcpTfBEv7Pg/cq/E9/ovouVQKX2MWMwY5ErZZRWmfc20gWK1T89hu+THfWJqGzOe6 CzA7LNT3yMZcHdJggP/7tfUkYqXAD1CSFsNyVug8P2XohAYxcgOIVSUFAPWO5jlaT4CViV8j/ 3+JnU9ZXvcj3AVo284Hl+LeQFkDHLgK3oyxmlqn2WekqfQwm98VFnDVy7+BMKPvN7mabLSObM O5L7RvJkLuJQ/jqervAFpQIQadbT5KmsAg/eozGNXzwF6b5TQbmSUqacFl1xkTDtbHGtRRxmD 9OlJxUwEUprL7JYG+SPKYYtESmYyJBpl2gwRGZbrEsK+sglA3RT5UBg7JjcTLSFJoQ1keu5fd bmkQgC54zI0YVmzI2wTKO/WhGLYvD/sgEe0FchAyRtG5TmxCwg1750u88DoGWLJt+d4IlGvXI 4Mc5eM6xRxA7FWg/7nKQHN91Y60RdBMuBEJL4Fn4pLRc7e87OE2gcRg49T1zA7hGhfoAWNNne IHZs7ga+SUKRamSlNHYzv3X+PwqrpO95LlHdYUZdGZoRYsLjygLNFSwZ8awuZ/wjRWasrPX22 XntKSboFHKLVVtGycIjfMi6oiWKOUr/u+gNXpcCHIGIJbg+KkSg08qHassdnEP5BWJeFPfR/i 0TJrW0I6oAV8Rg1e4jyE26Q+iP61WXH4YquhmXgh0hIyx5YpSDYXTZQyVgs5DgqZjuZC0Fl5o 7OoEUiu1SKQ7zRG7QhhQL0dEeqyQ6EKyJ++8ntVMyzszopcOLc= 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: dri-devel@lists.freedesktop.org, Arnd Bergmann , Mika Kuoppala , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Chris Wilson , Daniele Ceraolo Spurio , Matthew Auld , "Robert M. Fosha" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" gcc-9 gets confused by the code flow in check_dirty_whitelist: drivers/gpu/drm/i915/gt/selftest_workarounds.c: In function 'check_dirty_whitelist': drivers/gpu/drm/i915/gt/selftest_workarounds.c:492:17: error: 'rsvd' may be used uninitialized in this function [-Werror=maybe-uninitialized] I could not figure out a good way to do this in a way that gcc understands better, so initialize the variable to zero, as last resort. Fixes: aee20aaed887 ("drm/i915: Implement read-only support in whitelist selftest") Signed-off-by: Arnd Bergmann Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/gt/selftest_workarounds.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/gt/selftest_workarounds.c b/drivers/gpu/drm/i915/gt/selftest_workarounds.c index 5ed323254ee1..32785463ec9e 100644 --- a/drivers/gpu/drm/i915/gt/selftest_workarounds.c +++ b/drivers/gpu/drm/i915/gt/selftest_workarounds.c @@ -623,6 +623,8 @@ static int check_dirty_whitelist(struct intel_context *ce) err = -EINVAL; goto out_unpin; } + } else { + rsvd = 0; } expect = results[0];