summaryrefslogtreecommitdiffstats
path: root/drivers/staging/xgifb
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2011-11-27 23:03:19 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-28 06:20:13 +0900
commit6596fc06e48cdd2a3d47bb3e9a58d554abaad40f (patch)
treebb9145f0b58018a9b3c2d6e4fbba5a10bb2d6325 /drivers/staging/xgifb
parentebe33024101782b6325dab289e6471a61be923ee (diff)
downloadblackbird-op-linux-6596fc06e48cdd2a3d47bb3e9a58d554abaad40f.tar.gz
blackbird-op-linux-6596fc06e48cdd2a3d47bb3e9a58d554abaad40f.zip
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: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/xgifb')
-rw-r--r--drivers/staging/xgifb/vb_setmode.c45
1 files changed, 16 insertions, 29 deletions
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index 0b7800242928..632ebfa7c408 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -4547,36 +4547,23 @@ static void XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex,
temp -= 6;
}
}
- } else {
- if (!(modeflag & HalfDCLK)) {
- temp -= 4;
- if (pVBInfo->LCDResInfo != Panel1280x960) {
- if (pVBInfo->VGAHDE >= 800) {
- temp -= 7;
- if (pVBInfo->ModeType ==
- ModeEGA) {
- if (pVBInfo->VGAVDE ==
- 1024) {
- temp += 15;
- if (pVBInfo->LCDResInfo != Panel1280x1024) {
- temp +=
- 7;
- }
- }
- }
-
- if (pVBInfo->VGAHDE >= 1280) {
- if (pVBInfo->LCDResInfo
- != Panel1280x960) {
- if (pVBInfo->LCDInfo
- & LCDNonExpanding) {
- temp
- += 28;
- }
- }
- }
- }
+ } else if (!(modeflag & HalfDCLK)) {
+ temp -= 4;
+ if (pVBInfo->LCDResInfo != Panel1280x960 &&
+ pVBInfo->VGAHDE >= 800) {
+ temp -= 7;
+ if (pVBInfo->ModeType == ModeEGA &&
+ pVBInfo->VGAVDE == 1024) {
+ temp += 15;
+ if (pVBInfo->LCDResInfo !=
+ Panel1280x1024)
+ temp += 7;
}
+
+ if (pVBInfo->VGAHDE >= 1280 &&
+ pVBInfo->LCDResInfo != Panel1280x960 &&
+ (pVBInfo->LCDInfo & LCDNonExpanding))
+ temp += 28;
}
}
}
OpenPOWER on IntegriCloud