Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751302AbdISCxH (ORCPT ); Mon, 18 Sep 2017 22:53:07 -0400 Received: from mail-yw0-f194.google.com ([209.85.161.194]:35073 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750982AbdISCxG (ORCPT ); Mon, 18 Sep 2017 22:53:06 -0400 X-Google-Smtp-Source: ADKCNb40J5PoK9EIBl3dK4oeKffQT6gZTR0hJvt8QVbjh3uvAby7mKtuAtNf8MWhFjah7X7p8dGZGEuJA1stIlMAEs4= MIME-Version: 1.0 In-Reply-To: <79f75c67-b230-62f0-ac69-88c66b8c6461@gmail.com> References: <20170915200705.1639795-1-arnd@arndb.de> <79f75c67-b230-62f0-ac69-88c66b8c6461@gmail.com> From: Alex Deucher Date: Mon, 18 Sep 2017 22:53:05 -0400 Message-ID: Subject: Re: [PATCH] drm/radeon: properly initialize r600_audio_status() data To: Christian Koenig Cc: Arnd Bergmann , Alex Deucher , David Airlie , amd-gfx list , Maling list - DRI developers , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v8J2rCLo015448 Content-Length: 1903 Lines: 55 On Sat, Sep 16, 2017 at 8:20 AM, Christian König wrote: > Am 15.09.2017 um 22:06 schrieb Arnd Bergmann: >> >> 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 Applied. thanks! Alex > >> --- >> 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); > > > > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx