Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751704AbdIOUHQ (ORCPT ); Fri, 15 Sep 2017 16:07:16 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:56897 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751556AbdIOUHO (ORCPT ); Fri, 15 Sep 2017 16:07:14 -0400 From: Arnd Bergmann To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie Cc: Arnd Bergmann , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org 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== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1386 Lines: 33 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 --- 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); -- 2.9.0