mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/5] staging/xgifb: Remove uneccessary/simply if in XGINew_GetXG20DRAMType
@ 2013-05-13 21:41 Peter Huewe
  2013-05-13 21:41 ` [PATCH 2/5] staging/xgifb: Remove unnecessary cases in XGINew_SenseLCD Peter Huewe
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Peter Huewe @ 2013-05-13 21:41 UTC (permalink / raw)
  To: Arnaud Patard
  Cc: Greg Kroah-Hartman, Peter Huewe, Aaro Koskinen,
	Miguel Gómez, devel, linux-kernel

Instead of storing the value in a temp variable, anding it with 1 and
assign data conditionally we can assign the value directly.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
 drivers/staging/xgifb/vb_init.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 19ce5a9..9caf12a 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -54,14 +54,12 @@ XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension,
 		udelay(800);
 		xgifb_reg_or(pVBInfo->P3d4, 0x4A, 0x80); /* Enable GPIOH read */
 		/* GPIOF 0:DVI 1:DVO */
-		temp = xgifb_reg_get(pVBInfo->P3d4, 0x48);
+		data = xgifb_reg_get(pVBInfo->P3d4, 0x48);
 		/* HOTPLUG_SUPPORT */
 		/* for current XG20 & XG21, GPIOH is floating, driver will
 		 * fix DDR temporarily */
-		if (temp & 0x01) /* DVI read GPIOH */
-			data = 1; /* DDRII */
-		else
-			data = 0; /* DDR */
+		/* DVI read GPIOH */
+		data &= 0x01; /* 1=DDRII, 0=DDR */
 		/* ~HOTPLUG_SUPPORT */
 		xgifb_reg_or(pVBInfo->P3d4, 0xB4, 0x02);
 		return data;
-- 
1.8.1.5


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-13 21:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-13 21:41 [PATCH 1/5] staging/xgifb: Remove uneccessary/simply if in XGINew_GetXG20DRAMType Peter Huewe
2013-05-13 21:41 ` [PATCH 2/5] staging/xgifb: Remove unnecessary cases in XGINew_SenseLCD Peter Huewe
2013-05-13 21:41 ` [PATCH 3/5] staging/xgifb: Consolidate function almost identical calls in XGINew_GetXG21Sense Peter Huewe
2013-05-13 21:41 ` [PATCH 4/5] staging/xgifb: Remove unnecessary binary calculation in GetXG27FPBits Peter Huewe
2013-05-13 21:41 ` [PATCH 5/5] staging/xgifb: Fix always false condition in vb_setmode.c (smatch) Peter Huewe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®