Skip to content

Commit

Permalink
staging/xgifb: Remove unnecessary bitshifts in XGI_SetCRT1ModeRegs
Browse files Browse the repository at this point in the history
Since data can only be 0x0000, 0x0035 or 0x0048 we can simply skip the
bit shifting and masking as data & 0xFF is always equal to data and
data & 0xFF00 is always 0.
So we simply use data and 0 directly and save the assignment.

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 a5e080b commit 5d1c2a9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/staging/xgifb/vb_setmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,10 +1083,8 @@ static void XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension,
data = 0x0048;
}

data2 = data & 0x00FF;
xgifb_reg_and_or(pVBInfo->P3d4, 0x19, 0xFF, data2);
data2 = (data & 0xFF00) >> 8;
xgifb_reg_and_or(pVBInfo->P3d4, 0x19, 0xFC, data2);
xgifb_reg_and_or(pVBInfo->P3d4, 0x19, 0xFF, data);
xgifb_reg_and_or(pVBInfo->P3d4, 0x19, 0xFC, 0);

if (modeflag & HalfDCLK)
xgifb_reg_and_or(pVBInfo->P3c4, 0x01, 0xF7, 0x08);
Expand Down

0 comments on commit 5d1c2a9

Please sign in to comment.