From patchwork Fri Sep 15 20:06:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 112758 Delivered-To: patch@linaro.org Received: by 10.80.163.150 with SMTP id s22csp942574edb; Fri, 15 Sep 2017 13:07:15 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7KZUOoFdy20HJivV7vFyvEZYcMw2kwTIv7ablK1nkiyoknu4NuBlyaEhaRwTzPfGyx+sfH X-Received: by 10.98.0.199 with SMTP id 190mr14276142pfa.298.1505506034954; Fri, 15 Sep 2017 13:07:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505506034; cv=none; d=google.com; s=arc-20160816; b=ph1JTYr8DiDj5uhGJVpSCsDBTWvrqVeIbRWgdsls1XPfpvfqMY2TnVGcYnwZwU5Fhl XjansljJt63WSEYNRNfDxVsbHgfVaRZO47KOvjJ0NznM9CVDHeXZ+1uZsZJU0Zu80+QT oua6hRLdAJvCyBvhJ1++pZp/p+tTX1exUyZxZQ/AQTvq7sgnwDUSkZ6EbhHFthLRowbA JcLhiAxspNXXzLyQNh6mJshokfiheR5Iyq2D2RKQGGRxdKyJzLMAPxAI0UeJDRwG/CYz /6ZmTfeDwH1f//xRKzM2CsE/L30GbTJQKLyoPOOw7hDK/M6P/4UDbBv2khxrQ/HHEw3s tSkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=TlSzLjDil52cjYhVVoZrjQTpjkk6+HsDueXkzp5rx/4=; b=q+NC6j81kjIK+l2efdrZLFdCECVz/adMMFYcfvSsB593Hi7+JMP061T7kaowk9doZa g3wLDflgHZzRH2GV0TFXP1ww3CHE30ByqdiwXxDqTN9gGa8DHJ5t1pqQP5ovl+clYabg fNC54k5OhaSIDniWr0Z4yv6ykCCOgI4puUppNSNPfAUbq0IlTWQIuwtPDrURlcgRQYgx infQGCWaJujXW6Anw/0g4Ye+JDtGLKBbdzfqAjcH4ge8D47K3zj/yQ+WWPUzKbAcrJIu NtLedcJLFRsFeiIBKSuce7CFkG/ehQWRwwdXT27IayZXbT77h3nMrkJuvyZkHL3+v6yS XlPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 71si1096245pfs.5.2017.09.15.13.07.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Sep 2017 13:07:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) 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 7B74C6E1D7; Fri, 15 Sep 2017 20:07:13 +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.135]) by gabe.freedesktop.org (Postfix) with ESMTPS id 93B3B6E1D7; Fri, 15 Sep 2017 20:07:12 +0000 (UTC) Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0LckOB-1dAmZJ3mb9-00kAts; Fri, 15 Sep 2017 22:07:07 +0200 From: Arnd Bergmann To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= , David Airlie Subject: [PATCH] drm/radeon: properly initialize r600_audio_status() data Date: Fri, 15 Sep 2017 22:06:58 +0200 Message-Id: <20170915200705.1639795-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:aX4yCloeCmRCQv0LF3hhwekbvhTDd0RTQvRkcAR2o8QbeJ6YD8p rRB55p3CcVaGefPfQhpiGC9vOTPBjNeG95YazWCIyrx/nxO9lcuSTdArjPHj+4sgd4re/mV lM7xtR1RUHm0pGasSWko03mDGm5Cwg7qs+9nh7M8b0q7ATY5OWCoQAzbXRuGaUjWLKU1vco MxUXo5Vbr9+TtzarCv3Og== X-UI-Out-Filterresults: notjunk:1; V01:K0:whcnXaEjnxU=:Q8SuEVtwHxfKyZTm4/Zd+d UWGQBzv+4WrQE31U2ajroL4T/YhH2Pu/di5O8mIEv96Wp8wNrCoCWUwsaRog2x76nUPj2+eXr 36c33/0l0ljF5xUXvl8pP35borunEGlRUNtRouv+jjVcXkJ9+3zb0iyvNkxKOOl/JRFvvabBy ejEZyn2GEvZ8u97KZ5qdQwbAqV1aVHJ1n9Es/06SNVnmJNd50ElTrAMXZQJ/90yJvTyDXqdS8 ryiuITeYQUPiujWGAoJiccmtyINd6TnLNhNpqZ9l9Pk+j4tOMJqpcMiBxAipuzDaCfO3/SgwX KYAXRQpU4ip/ml+jfwonqG9CQC2GQxyLFqh04V6d+tdx/D5VJ9OVre27lOKMsrrVVGs5fC2oN s60lUhcL1C2UHnCON0FsVxqyxtx3sNGZSztS/d0zI9l9CRCTBb+yUTsaGpkGK5fIYAdHHhUad 3cOkl30QUwEYTMTLHVXZ4R8opTrcgVrU+TbdtthLAxe002HN13QF7iAxayoeSpLzqj2wqmJEb Xm1mQxCbTuq6R4dEMem+p6cGCal6Zar6YRUN/eR8ydJrx0GD3LrieZN66clIKUIQ+OqTa89Jx xhc8WzYzopfcUuXOzzBGvhLuf4fNDTejkdhlM/tWuFHnN1EiR2KEsLvq5ohSIdbcGg/LKY/ka P0v/UkP+iFwGLOgauNeROx4keN5FjlOrVKmVfkxfuSQnPoq2l2GoBiQrqIvonxpL7cZCMZaVz a3qWscuo+vIS04PbZL4Q8crZgBj7tzFxrTIgqQ== Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Arnd Bergmann , linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The structure returned from r600_audio_status() is only partially initialized, and older gcc versions (4.3 and 4.4) warn about this: drivers/gpu/drm/radeon/r600_hdmi.c: In function 'r600_audio_status': drivers/gpu/drm/radeon/r600_hdmi.c:108: error: 'status.id' is used uninitialized in this function drivers/gpu/drm/radeon/r600_hdmi.c:108: error: 'status.connected' is used uninitialized in this function drivers/gpu/drm/radeon/r600_hdmi.c:108: error: 'status.offset' is used uninitialized in this function This is harmless and surprisingly correct in C99, as the caller only accesses the fields that got initialized, so newer compilers don't warn about it, but initializing the entire structure feels like the right thing to do here and avoids the warning. Signed-off-by: Arnd Bergmann Reviewed-by: Christian König --- drivers/gpu/drm/radeon/r600_hdmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c index e82a99cb2459..ab32830c4e23 100644 --- a/drivers/gpu/drm/radeon/r600_hdmi.c +++ b/drivers/gpu/drm/radeon/r600_hdmi.c @@ -58,7 +58,7 @@ enum r600_hdmi_iec_status_bits { static struct r600_audio_pin r600_audio_status(struct radeon_device *rdev) { - struct r600_audio_pin status; + struct r600_audio_pin status = {}; uint32_t value; value = RREG32(R600_AUDIO_RATE_BPS_CHANNEL);