Commit 6596fc06 authored by Aaro Koskinen's avatar Aaro Koskinen Committed by Greg Kroah-Hartman

staging: xgifb: vb_setmode: reduce if nesting in XGI_SetLockRegs()

Eliminate unnecessary nesting levels by rearranging code and conditions.
The resulting code should be still identical.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ebe33024
...@@ -4547,36 +4547,23 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex, ...@@ -4547,36 +4547,23 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
temp -= 6; temp -= 6;
} }
} }
} else { } else if (!(modeflag & HalfDCLK)) {
if (!(modeflag & HalfDCLK)) {
temp -= 4; temp -= 4;
if (pVBInfo->LCDResInfo != Panel1280x960) { if (pVBInfo->LCDResInfo != Panel1280x960 &&
if (pVBInfo->VGAHDE >= 800) { pVBInfo->VGAHDE >= 800) {
temp -= 7; temp -= 7;
if (pVBInfo->ModeType == if (pVBInfo->ModeType == ModeEGA &&
ModeEGA) { pVBInfo->VGAVDE == 1024) {
if (pVBInfo->VGAVDE ==
1024) {
temp += 15; temp += 15;
if (pVBInfo->LCDResInfo != Panel1280x1024) { if (pVBInfo->LCDResInfo !=
temp += Panel1280x1024)
7; temp += 7;
}
}
} }
if (pVBInfo->VGAHDE >= 1280) { if (pVBInfo->VGAHDE >= 1280 &&
if (pVBInfo->LCDResInfo pVBInfo->LCDResInfo != Panel1280x960 &&
!= Panel1280x960) { (pVBInfo->LCDInfo & LCDNonExpanding))
if (pVBInfo->LCDInfo temp += 28;
& LCDNonExpanding) {
temp
+= 28;
}
}
}
}
}
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment