summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_atombios.c
diff options
context:
space:
mode:
authorAndre Heider <a.heider@gmail.com>2013-07-17 14:02:23 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-07-17 14:52:49 -0400
commit48fa04c3fcdb4f6ac041976bedaf19ca5bee20c0 (patch)
tree18ec36d9e60ba283709cd5c758358127db13eb48 /drivers/gpu/drm/radeon/radeon_atombios.c
parent77c7d50a4a9f1fa3aa42adad00e7b44aa70ec910 (diff)
downloadlwn-48fa04c3fcdb4f6ac041976bedaf19ca5bee20c0.tar.gz
lwn-48fa04c3fcdb4f6ac041976bedaf19ca5bee20c0.zip
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>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_atombios.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_atombios.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c
index a2e324188bc9..2606ec680ae3 100644
--- a/drivers/gpu/drm/radeon/radeon_atombios.c
+++ b/drivers/gpu/drm/radeon/radeon_atombios.c
@@ -3703,8 +3703,9 @@ int radeon_atom_init_mc_reg_table(struct radeon_device *rdev,
sizeof(ATOM_INIT_REG_INDEX_FORMAT)) - 1;
if (num_entries > VBIOS_MC_REGISTER_ARRAY_SIZE)
return -EINVAL;
- while (!(reg_block->asRegIndexBuf[i].ucPreRegDataLength & ACCESS_PLACEHOLDER) &&
- (i < num_entries)) {
+ while (i < num_entries) {
+ if (reg_block->asRegIndexBuf[i].ucPreRegDataLength & ACCESS_PLACEHOLDER)
+ break;
reg_table->mc_reg_address[i].s1 =
(u16)(le16_to_cpu(reg_block->asRegIndexBuf[i].usRegIndex));
reg_table->mc_reg_address[i].pre_reg_data =