Skip to content

Commit

Permalink
staging/xgifb: Remove redundant if statement
Browse files Browse the repository at this point in the history
The code checks twice for if (pVBInfo->VBInfo & SetCRT2ToTV) without any
changes in between -> we can remove the second check.
And while at it we can also save the temp variable and use tempbx
directly.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Huewe authored and Greg Kroah-Hartman committed Feb 4, 2013
1 parent a9e29e6 commit 5fc699f
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions drivers/staging/xgifb/vb_setmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2197,31 +2197,25 @@ static void XGI_GetVBInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
static void XGI_GetTVInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
struct vb_device_info *pVBInfo)
{
unsigned short temp, tempbx = 0, resinfo = 0, modeflag, index1;

tempbx = 0;
resinfo = 0;
unsigned short tempbx = 0, resinfo = 0, modeflag, index1;

if (pVBInfo->VBInfo & SetCRT2ToTV) {
modeflag = XGI330_EModeIDTable[ModeIdIndex].Ext_ModeFlag;
resinfo = XGI330_EModeIDTable[ModeIdIndex].Ext_RESINFO;

if (pVBInfo->VBInfo & SetCRT2ToTV) {
temp = xgifb_reg_get(pVBInfo->P3d4, 0x35);
tempbx = temp;
if (tempbx & TVSetPAL) {
tempbx &= (SetCHTVOverScan |
TVSetPALM |
TVSetPALN |
TVSetPAL);
if (tempbx & TVSetPALM)
/* set to NTSC if PAL-M */
tempbx &= ~TVSetPAL;
} else
tempbx &= (SetCHTVOverScan |
TVSetNTSCJ |
TVSetPAL);
}
tempbx = xgifb_reg_get(pVBInfo->P3d4, 0x35);
if (tempbx & TVSetPAL) {
tempbx &= (SetCHTVOverScan |
TVSetPALM |
TVSetPALN |
TVSetPAL);
if (tempbx & TVSetPALM)
/* set to NTSC if PAL-M */
tempbx &= ~TVSetPAL;
} else
tempbx &= (SetCHTVOverScan |
TVSetNTSCJ |
TVSetPAL);

if (pVBInfo->IF_DEF_LVDS == 0) {
if (pVBInfo->VBInfo & SetCRT2ToSCART)
Expand Down

0 comments on commit 5fc699f

Please sign in to comment.