Re: if (a & X || b & ~Y) in dasd.c

bill davidsen (davidsen@tmr.com)
Mon, 19 Nov 2001 13:40:45 -0500


In article <20011108155749.A24023@devserv.devel.redhat.com> zaitcev@redhat.com wrote:
>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 ||
> stat->dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) {

If the code does what I think it does, it works as written. However, I
usually would throw in parenthesis on something like this to be sure
that the next person reading the code won't waste time thinking about
it. I always thought that good code was literature, which could be read,
understood, and enjoyed by many.

-- 
bill davidsen <davidsen@tmr.com>
  His first management concern is not solving the problem, but covering
his ass. If he lived in the middle ages he'd wear his codpiece backward.
-
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/