aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Huewe <peterhuewe@gmx.de>2013-02-15 14:37:13 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-15 18:12:40 -0500
commit771f3eed631be02b08544fc46cdfd2558599cf5d (patch)
tree0f9b9e811176832bebc2a8a0f7692e0d0b0ff38a
parent053004b375ca8f684f778d354eeeaf4e8b17c1f0 (diff)
staging/xgifb: Remove duplicated code in loops.
Instead of calling the same function three times in a loop, multiply the loop counter by three. And since the value in DAC_TEST_PARMS is always the same we can use the value directly. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/xgifb/vb_setmode.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index edbe70ba1a91..dfa5303379e9 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -5464,7 +5464,6 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo)
5464 5464
5465 unsigned char CR17, CR63, SR31; 5465 unsigned char CR17, CR63, SR31;
5466 unsigned short temp; 5466 unsigned short temp;
5467 unsigned char DAC_TEST_PARMS[3] = { 0x0F, 0x0F, 0x0F };
5468 5467
5469 int i; 5468 int i;
5470 xgifb_reg_set(pVBInfo->P3c4, 0x05, 0x86); 5469 xgifb_reg_set(pVBInfo->P3c4, 0x05, 0x86);
@@ -5518,10 +5517,8 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo)
5518 5517
5519 outb(0x00, pVBInfo->P3c8); 5518 outb(0x00, pVBInfo->P3c8);
5520 5519
5521 for (i = 0; i < 256; i++) { 5520 for (i = 0; i < 256 * 3; i++) {
5522 outb((unsigned char) DAC_TEST_PARMS[0], (pVBInfo->P3c8 + 1)); 5521 outb(0x0F, (pVBInfo->P3c8 + 1)); /* DAC_TEST_PARMS */
5523 outb((unsigned char) DAC_TEST_PARMS[1], (pVBInfo->P3c8 + 1));
5524 outb((unsigned char) DAC_TEST_PARMS[2], (pVBInfo->P3c8 + 1));
5525 } 5522 }
5526 5523
5527 mdelay(1); 5524 mdelay(1);
@@ -5537,9 +5534,7 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo)
5537 /* avoid display something, set BLACK DAC if not restore DAC */ 5534 /* avoid display something, set BLACK DAC if not restore DAC */
5538 outb(0x00, pVBInfo->P3c8); 5535 outb(0x00, pVBInfo->P3c8);
5539 5536
5540 for (i = 0; i < 256; i++) { 5537 for (i = 0; i < 256 * 3; i++) {
5541 outb(0, (pVBInfo->P3c8 + 1));
5542 outb(0, (pVBInfo->P3c8 + 1));
5543 outb(0, (pVBInfo->P3c8 + 1)); 5538 outb(0, (pVBInfo->P3c8 + 1));
5544 } 5539 }
5545 5540