]> git.baikalelectronics.ru Git - kernel.git/commit
drm/radeon: properly initialize r600_audio_status() data
authorArnd Bergmann <arnd@arndb.de>
Fri, 15 Sep 2017 20:06:58 +0000 (22:06 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Sep 2017 03:30:30 +0000 (23:30 -0400)
commitfaaf6fd228f02e81a4dab1efa41dfb57c7c8e258
treeca4d99577b8263887ffd508b0229b96843a8915e
parent1d6a882aa23478027e7117415880335f4a253e38
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: Christian König <christian.koenig@amd.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/r600_hdmi.c