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

staging: xgifb: ReadVBIOSTablData(): rearrange code to avoid nesting

Rearrange code to avoid deep nesting.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b8e71975
...@@ -1100,9 +1100,11 @@ static void ReadVBIOSTablData(unsigned char ChipType, ...@@ -1100,9 +1100,11 @@ static void ReadVBIOSTablData(unsigned char ChipType,
unsigned char j, k; unsigned char j, k;
/* Volari customize data area end */ /* Volari customize data area end */
if (ChipType == XG21) { if (ChipType != XG21)
return;
pVBInfo->IF_DEF_LVDS = 0; pVBInfo->IF_DEF_LVDS = 0;
if (pVideoMemory[0x65] & 0x1) { if (!(pVideoMemory[0x65] & 0x1))
return;
pVBInfo->IF_DEF_LVDS = 1; pVBInfo->IF_DEF_LVDS = 1;
i = pVideoMemory[0x316] | (pVideoMemory[0x317] << 8); i = pVideoMemory[0x316] | (pVideoMemory[0x317] << 8);
j = pVideoMemory[i - 1]; j = pVideoMemory[i - 1];
...@@ -1111,8 +1113,7 @@ static void ReadVBIOSTablData(unsigned char ChipType, ...@@ -1111,8 +1113,7 @@ static void ReadVBIOSTablData(unsigned char ChipType,
k = 0; k = 0;
do { do {
pVBInfo->XG21_LVDSCapList[k].LVDS_Capability pVBInfo->XG21_LVDSCapList[k].LVDS_Capability
= pVideoMemory[i] | = pVideoMemory[i] | (pVideoMemory[i + 1] << 8);
(pVideoMemory[i + 1] << 8);
pVBInfo->XG21_LVDSCapList[k].LVDSHT pVBInfo->XG21_LVDSCapList[k].LVDSHT
= pVideoMemory[i + 2] | = pVideoMemory[i + 2] |
(pVideoMemory[i + 3] << 8); (pVideoMemory[i + 3] << 8);
...@@ -1137,29 +1138,19 @@ static void ReadVBIOSTablData(unsigned char ChipType, ...@@ -1137,29 +1138,19 @@ static void ReadVBIOSTablData(unsigned char ChipType,
pVBInfo->XG21_LVDSCapList[k].LVDSVSYNC pVBInfo->XG21_LVDSCapList[k].LVDSVSYNC
= pVideoMemory[i + 16] | = pVideoMemory[i + 16] |
(pVideoMemory[i + 17] << 8); (pVideoMemory[i + 17] << 8);
pVBInfo->XG21_LVDSCapList[k].VCLKData1 pVBInfo->XG21_LVDSCapList[k].VCLKData1 = pVideoMemory[i + 18];
= pVideoMemory[i + 18]; pVBInfo->XG21_LVDSCapList[k].VCLKData2 = pVideoMemory[i + 19];
pVBInfo->XG21_LVDSCapList[k].VCLKData2 pVBInfo->XG21_LVDSCapList[k].PSC_S1 = pVideoMemory[i + 20];
= pVideoMemory[i + 19]; pVBInfo->XG21_LVDSCapList[k].PSC_S2 = pVideoMemory[i + 21];
pVBInfo->XG21_LVDSCapList[k].PSC_S1 pVBInfo->XG21_LVDSCapList[k].PSC_S3 = pVideoMemory[i + 22];
= pVideoMemory[i + 20]; pVBInfo->XG21_LVDSCapList[k].PSC_S4 = pVideoMemory[i + 23];
pVBInfo->XG21_LVDSCapList[k].PSC_S2 pVBInfo->XG21_LVDSCapList[k].PSC_S5 = pVideoMemory[i + 24];
= pVideoMemory[i + 21];
pVBInfo->XG21_LVDSCapList[k].PSC_S3
= pVideoMemory[i + 22];
pVBInfo->XG21_LVDSCapList[k].PSC_S4
= pVideoMemory[i + 23];
pVBInfo->XG21_LVDSCapList[k].PSC_S5
= pVideoMemory[i + 24];
i += 25; i += 25;
j--; j--;
k++; k++;
} while ((j > 0) && } while ((j > 0) &&
(k < (sizeof(XGI21_LCDCapList) / (k < (sizeof(XGI21_LCDCapList) /
sizeof(struct sizeof(struct XGI21_LVDSCapStruct))));
XGI21_LVDSCapStruct))));
}
}
} }
static void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension, static void XGINew_ChkSenseStatus(struct xgi_hw_device_info *HwDeviceExtension,
......
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