提交 ecfaa00c 编写于 作者: P Peter Huewe 提交者: Greg Kroah-Hartman

staging/xgifb: Remove unused variables and dead assignments

The variables A,HBS and VBS are never read in XGIfb_mode_rate_to_ddata
and the assignment has no side effects -> so we can simply remove them.
Removing them causes VT, HT and cr_data3 to be unused -> remove them as well
and remove the assignmens to cr_data which are shadowed by a different
assignment a few lines later.
Signed-off-by: NPeter Huewe <peterhuewe@gmx.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 e2d979cc
......@@ -91,11 +91,10 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
unsigned short ModeIdIndex, index = 0;
unsigned short RefreshRateTableIndex = 0;
unsigned short VRE, VBE, VRS, VBS, VDE, VT;
unsigned short HRE, HBE, HRS, HBS, HDE, HT;
unsigned short VRE, VBE, VRS, VDE;
unsigned short HRE, HBE, HRS, HDE;
unsigned char sr_data, cr_data, cr_data2;
unsigned long cr_data3;
int A, B, C, D, E, F, temp, j;
int B, C, D, E, F, temp, j;
InitTo330Pointer(HwDeviceExtension->jChipType, XGI_Pr);
if (!XGI_SearchModeID(ModeNo, &ModeIdIndex, XGI_Pr))
return 0;
......@@ -105,12 +104,6 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
sr_data = XGI_CRT1Table[index].CR[5];
cr_data = XGI_CRT1Table[index].CR[0];
/* Horizontal total */
HT = (cr_data & 0xff) | ((unsigned short) (sr_data & 0x03) << 8);
A = HT + 5;
HDE = (XGI330_RefIndex[RefreshRateTableIndex].XRes >> 3) - 1;
E = HDE + 1;
......@@ -120,11 +113,6 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
HRS = (cr_data & 0xff) | ((unsigned short) (sr_data & 0xC0) << 2);
F = HRS - E - 3;
cr_data = XGI_CRT1Table[index].CR[1];
/* Horizontal blank start */
HBS = (cr_data & 0xff) | ((unsigned short) (sr_data & 0x30) << 4);
sr_data = XGI_CRT1Table[index].CR[6];
cr_data = XGI_CRT1Table[index].CR[2];
......@@ -152,16 +140,8 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
sr_data = XGI_CRT1Table[index].CR[14];
cr_data = XGI_CRT1Table[index].CR[8];
cr_data2 = XGI_CRT1Table[index].CR[9];
/* Vertical total */
VT = (cr_data & 0xFF) | ((unsigned short) (cr_data2 & 0x01) << 8)
| ((unsigned short) (cr_data2 & 0x20) << 4)
| ((unsigned short) (sr_data & 0x01) << 10);
A = VT + 2;
VDE = XGI330_RefIndex[RefreshRateTableIndex].YRes - 1;
E = VDE + 1;
......@@ -173,15 +153,6 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
| ((unsigned short) (sr_data & 0x08) << 7);
F = VRS + 1 - E;
cr_data = XGI_CRT1Table[index].CR[12];
cr_data3 = (XGI_CRT1Table[index].CR[14] & 0x80) << 5;
/* Vertical blank start */
VBS = (cr_data & 0xff) | ((unsigned short) (cr_data2 & 0x08) << 5)
| ((unsigned short) (cr_data3 & 0x20) << 4)
| ((unsigned short) (sr_data & 0x04) << 8);
cr_data = XGI_CRT1Table[index].CR[13];
/* Vertical blank end */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册