]> 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)
commite88206465578c4a7b9ebf2a69d040c0dc0fbc920
treeca4d99577b8263887ffd508b0229b96843a8915e
parentcf661ec1ff146183a6f8da1f1d41c1e3c4afe8bd
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