* [patch] Staging: xgfib: put parenthesis in the right place
@ 2011-01-04 4:58 Dan Carpenter
2011-01-04 5:20 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-01-04 4:58 UTC (permalink / raw)
To: kernel-janitors
In the original code the parenthesis are in the wrong position, so the
conditions are always true.
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
Compile tested only.
diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
index 7016fdd..0d69a88 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] Staging: xgfib: put parenthesis in the right place
2011-01-04 4:58 [patch] Staging: xgfib: put parenthesis in the right place Dan Carpenter
@ 2011-01-04 5:20 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2011-01-04 5:20 UTC (permalink / raw)
To: kernel-janitors
On Tue, 2011-01-04 at 07:58 +0300, Dan Carpenter wrote:
> diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c
> @@ -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))
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-04 5:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-04 4:58 [patch] Staging: xgfib: put parenthesis in the right place Dan Carpenter
2011-01-04 5:20 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox