Skip to contentSkip to conversation

Staging: xgfib: put parenthesis in the right place

PATCH Superseded Dan Carpenter 2 participants 2 messages Jan 4, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: xgfib: put parenthesis in the right place

In the original code the parenthesis are in the wrong position, so the conditions are always true.

---
Compile tested only.

drivers/staging/xgifb/vb_setmode.c +2 -2
index 7016fdd..0d69a88 100644
@@ -3954,7 +3954,7 @@ void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
 unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo)
 {
 
-	if ((((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA))
+	if ((pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))
 			&& (pVBInfo->LCDInfo & SetLCDDualLink)) /* shampoo0129 */
 		return 1;
 
@@ -8773,7 +8773,7 @@ unsigned short XGI_GetVCLK2Ptr(unsigned short ModeNo,
 
 	if (pVBInfo->IF_DEF_LVDS = 0) {
 		CRT2Index = CRT2Index >> 6; /*  for LCD */
-		if (((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA)) { /*301b*/
+		if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { /*301b*/
 			if (pVBInfo->LCDResInfo != Panel1024x768)
 				VCLKIndex = LCDXlat2VCLK[CRT2Index];
 			else
#1 lore raw

drivers/staging/xgifb/vb_setmode.c void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex, · line 3958

Quoted 8 lines · Dan Carpenter
drivers/staging/xgifb/vb_setmode.c +1 -1
@@ -3954,7 +3954,7 @@ void XGI_GetCRT2ResInfo(unsigned short ModeNo, unsigned short ModeIdIndex,
 unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo)
 {
 
-	if ((((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA))
+	if ((pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))
 			&& (pVBInfo->LCDInfo & SetLCDDualLink)) /* shampoo0129 */

Perhaps more legible and standard as:

	if ((pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) &&
	    (pVBInfo->LCDInfo & SetLCDDualLink))