lkml.org 
[lkml]   [2001]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: if (a & X || b & ~Y) in dasd.c
On Thu, 8 Nov 2001, Pete Zaitcev wrote:

It looks okay, but it sure is hard to read. I will simplify...

> Carsten and others:
>
> this code in 2.2.14 looks suspicious to me:
>
> ./drivers/s390/block/dasd.c:
> /* first of all lets try to find out the appropriate era_action */
> if (stat->flag & DEVSTAT_FLAG_SENSE_AVAIL ||

if (value & MASK ||

> stat->dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) {

another_value & ANOTHER_MASK )

(if ether of these are TRUE)

... etc.
Don't confuse & with &&....

> Are you sure any parenthesises are not needed here?

No, but they sure would help to make the code readable by humans
as well as compilers.


Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

I was going to compile a list of innovations that could be
attributed to Microsoft. Once I realized that Ctrl-Alt-Del
was handled in the BIOS, I found that there aren't any.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:13    [W:0.138 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site