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

[zaitce] Date: Thu, 8 Nov 2001 15:57:49 -0500
[zaitce] From: Pete Zaitcev <>
[zaitce] To:
[zaitce] Cc:,
[zaitce] Subject: if (a & X || b & ~Y) in dasd.c
[zaitce] Carsten and others:
[zaitce] this code in 2.2.14 looks suspicious to me:
[zaitce] ./drivers/s390/block/dasd.c:
[zaitce] /* first of all lets try to find out the appropriate era_action */
[zaitce] if (stat->flag & DEVSTAT_FLAG_SENSE_AVAIL ||
[zaitce] stat->dstat & ~(DEV_STAT_CHN_END | DEV_STAT_DEV_END)) {
[zaitce] /* anything abnormal ? */
[zaitce] if (device->discipline->examine_error == NULL ||
[zaitce] stat->flag & DEVSTAT_HALT_FUNCTION) {
[zaitce] era = dasd_era_fatal;
[zaitce] } else {
[zaitce] era = device->discipline->examine_error (cqr, stat);
[zaitce] }
[zaitce] DASD_DRIVER_DEBUG_EVENT (1, dasd_int_handler," era_code %d",
[zaitce] era);
[zaitce] }
[zaitce] Are you sure any parenthesises are not needed here?

I'm not going to pretend to know what the code is accomplishing, but as
a matter of C, those &'s aren't the same as &&'s and will get executed as
the || is tested. So the first one will get &'ded and if false then the
second will and if neither return true then we move on.

Or, perhaps I'm being an idiot and misunderstanding the question and the
code. In that case, I'll pretend I didn't say anything. :)

-[ ]-
-[ Rather be forgotten, than remembered for giving in. ]-
-[ ZZ = g ^ (xb * xa) mod p g = h^{(p-1)/q} mod p ]-

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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