public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] staging/xgifb: Consolidate if/else if with identical code branches
@ 2013-02-15 19:37 Peter Huewe
  2013-02-15 19:37 ` [PATCH 2/5] staging/xgifb: Remove unnecessary casts Peter Huewe
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Peter Huewe @ 2013-02-15 19:37 UTC (permalink / raw)
  To: Arnaud Patard
  Cc: Greg Kroah-Hartman, Aaro Koskinen, Peter Huewe, Miguel Gómez,
	devel, linux-kernel

Both branches of this if statement execute the same code.
Thus we can || them together and remove code duplication

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
---
 drivers/staging/xgifb/vb_setmode.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index 3d5c424..0b134af 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -5572,13 +5572,10 @@ static void XGI_EnableBridge(struct xgifb_video_info *xgifb_info,
 	if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV
 			| VB_SIS302LV | VB_XGI301C)) {
 		if (!(pVBInfo->SetFlag & DisableChA)) {
-			if (pVBInfo->SetFlag & EnableChA) {
+			if ((pVBInfo->SetFlag & EnableChA) ||
+			    (pVBInfo->VBInfo & SetCRT2ToDualEdge)) {
 				/* Power on */
 				xgifb_reg_set(pVBInfo->Part1Port, 0x1E, 0x20);
-			} else if (pVBInfo->VBInfo & SetCRT2ToDualEdge) {
-				/* Power on */
-				xgifb_reg_set(pVBInfo->Part1Port,
-						0x1E, 0x20);
 			}
 		}
 
-- 
1.7.8.6


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

end of thread, other threads:[~2013-02-18 11:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-15 19:37 [PATCH 1/5] staging/xgifb: Consolidate if/else if with identical code branches Peter Huewe
2013-02-15 19:37 ` [PATCH 2/5] staging/xgifb: Remove unnecessary casts Peter Huewe
2013-02-15 19:37 ` [PATCH 3/5] staging/xgifb: Remove code without effect Peter Huewe
2013-02-18 11:25   ` Dan Carpenter
2013-02-15 19:37 ` [PATCH 4/5] staging/xgifb: Consolidate return paths Peter Huewe
2013-02-15 19:37 ` [PATCH 5/5] staging/xgifb: Remove duplicated code in loops Peter Huewe
2013-02-18 11:18   ` Dan Carpenter

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