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

staging: xgifb: ReadVBIOSTablData(): avoid duplicating code

If the count (j) is 0xff, just do the loop once.
Signed-off-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 106e7cf3
...@@ -1106,11 +1106,11 @@ static void ReadVBIOSTablData(unsigned char ChipType, ...@@ -1106,11 +1106,11 @@ static void ReadVBIOSTablData(unsigned char ChipType,
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];
if (j != 0xff) { if (j == 0xff)
j = 1;
k = 0; k = 0;
do { do {
pVBInfo->XG21_LVDSCapList[k]. pVBInfo->XG21_LVDSCapList[k].LVDS_Capability
LVDS_Capability
= pVideoMemory[i] | = pVideoMemory[i] |
(pVideoMemory[i + 1] << 8); (pVideoMemory[i + 1] << 8);
pVBInfo->XG21_LVDSCapList[k].LVDSHT pVBInfo->XG21_LVDSCapList[k].LVDSHT
...@@ -1158,49 +1158,6 @@ static void ReadVBIOSTablData(unsigned char ChipType, ...@@ -1158,49 +1158,6 @@ static void ReadVBIOSTablData(unsigned char ChipType,
(k < (sizeof(XGI21_LCDCapList) / (k < (sizeof(XGI21_LCDCapList) /
sizeof(struct sizeof(struct
XGI21_LVDSCapStruct)))); XGI21_LVDSCapStruct))));
} else {
pVBInfo->XG21_LVDSCapList[0].LVDS_Capability
= pVideoMemory[i] |
(pVideoMemory[i + 1] << 8);
pVBInfo->XG21_LVDSCapList[0].LVDSHT
= pVideoMemory[i + 2] |
(pVideoMemory[i + 3] << 8);
pVBInfo->XG21_LVDSCapList[0].LVDSVT
= pVideoMemory[i + 4] |
(pVideoMemory[i + 5] << 8);
pVBInfo->XG21_LVDSCapList[0].LVDSHDE
= pVideoMemory[i + 6] |
(pVideoMemory[i + 7] << 8);
pVBInfo->XG21_LVDSCapList[0].LVDSVDE
= pVideoMemory[i + 8] |
(pVideoMemory[i + 9] << 8);
pVBInfo->XG21_LVDSCapList[0].LVDSHFP
= pVideoMemory[i + 10] |
(pVideoMemory[i + 11] << 8);
pVBInfo->XG21_LVDSCapList[0].LVDSVFP
= pVideoMemory[i + 12] |
(pVideoMemory[i + 13] << 8);
pVBInfo->XG21_LVDSCapList[0].LVDSHSYNC
= pVideoMemory[i + 14] |
(pVideoMemory[i + 15] << 8);
pVBInfo->XG21_LVDSCapList[0].LVDSVSYNC
= pVideoMemory[i + 16] |
(pVideoMemory[i + 17] << 8);
pVBInfo->XG21_LVDSCapList[0].VCLKData1
= pVideoMemory[i + 18];
pVBInfo->XG21_LVDSCapList[0].VCLKData2
= pVideoMemory[i + 19];
pVBInfo->XG21_LVDSCapList[0].PSC_S1
= pVideoMemory[i + 20];
pVBInfo->XG21_LVDSCapList[0].PSC_S2
= pVideoMemory[i + 21];
pVBInfo->XG21_LVDSCapList[0].PSC_S3
= pVideoMemory[i + 22];
pVBInfo->XG21_LVDSCapList[0].PSC_S4
= pVideoMemory[i + 23];
pVBInfo->XG21_LVDSCapList[0].PSC_S5
= pVideoMemory[i + 24];
}
} }
} }
} }
......
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