Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/radeon/dpm/atom: restructure logic to work around a compiler bug

It seems gcc 4.8.1 generates bogus code for the old logic causing
part of the function to get skipped.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=66932
https://bugs.freedesktop.org/show_bug.cgi?id=66972
https://bugs.freedesktop.org/show_bug.cgi?id=66945

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Andre Heider and committed by
Alex Deucher
48fa04c3 77c7d50a

+3 -2
+3 -2
drivers/gpu/drm/radeon/radeon_atombios.c
··· 3703 3703 sizeof(ATOM_INIT_REG_INDEX_FORMAT)) - 1; 3704 3704 if (num_entries > VBIOS_MC_REGISTER_ARRAY_SIZE) 3705 3705 return -EINVAL; 3706 - while (!(reg_block->asRegIndexBuf[i].ucPreRegDataLength & ACCESS_PLACEHOLDER) && 3707 - (i < num_entries)) { 3706 + while (i < num_entries) { 3707 + if (reg_block->asRegIndexBuf[i].ucPreRegDataLength & ACCESS_PLACEHOLDER) 3708 + break; 3708 3709 reg_table->mc_reg_address[i].s1 = 3709 3710 (u16)(le16_to_cpu(reg_block->asRegIndexBuf[i].usRegIndex)); 3710 3711 reg_table->mc_reg_address[i].pre_reg_data =