aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/xgifb
diff options
context:
space:
mode:
authorPeter Huewe <peterhuewe@gmx.de>2013-05-13 23:41:48 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-05-16 16:02:34 -0700
commit986eb9fad5da8bc498eb9d15d61efae4c4c407c1 (patch)
tree85fcc64f8386fddf5da95d063c4192f9754867b3 /drivers/staging/xgifb
parentstaging/xgifb: Consolidate function almost identical calls in XGINew_GetXG21Sense (diff)
downloadlinux-dev-986eb9fad5da8bc498eb9d15d61efae4c4c407c1.tar.xz
linux-dev-986eb9fad5da8bc498eb9d15d61efae4c4c407c1.zip
staging/xgifb: Remove unnecessary binary calculation in GetXG27FPBits
If temp <= 2 no other bits than the lowest two (0x03) can be set anyway -> this operation can be removed. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/xgifb')
-rw-r--r--drivers/staging/xgifb/vb_init.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index ba8796fb66d6..090c424d4670 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -1177,9 +1177,7 @@ static unsigned char GetXG27FPBits(struct vb_device_info *pVBInfo)
/* enable GPIOA/B/C read */
xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x03, 0x03);
temp = xgifb_reg_get(pVBInfo->P3d4, 0x48);
- if (temp <= 2)
- temp &= 0x03;
- else
+ if (temp > 2)
temp = ((temp & 0x04) >> 1) | ((~temp) & 0x01);
xgifb_reg_set(pVBInfo->P3d4, 0x4A, CR4A);