Commit e8820646 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Alex Deucher

drm/radeon: properly initialize r600_audio_status() data

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.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent cf661ec1
...@@ -58,7 +58,7 @@ enum r600_hdmi_iec_status_bits { ...@@ -58,7 +58,7 @@ enum r600_hdmi_iec_status_bits {
static struct r600_audio_pin r600_audio_status(struct radeon_device *rdev) 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; uint32_t value;
value = RREG32(R600_AUDIO_RATE_BPS_CHANNEL); value = RREG32(R600_AUDIO_RATE_BPS_CHANNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment