• Arnd Bergmann's avatar
    drm/radeon: properly initialize r600_audio_status() data · e8820646
    Arnd Bergmann authored
    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>
    e8820646
r600_hdmi.c 15.4 KB