diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-01-05 14:11:29 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-01-05 14:11:29 +0100 |
commit | 5faed5128d3c07f055f96d910529c95814073a09 (patch) | |
tree | 541b83a4f99fcc70ec73b1e313d052233a515390 /linux/src/drivers/scsi/NCR5380.c | |
parent | 8982de2eb4fa2fa6f5a350c348c211542aecfaa1 (diff) | |
download | gnumach-5faed5128d3c07f055f96d910529c95814073a09.tar.gz gnumach-5faed5128d3c07f055f96d910529c95814073a09.tar.bz2 gnumach-5faed5128d3c07f055f96d910529c95814073a09.zip |
linux: fix bit tests
The pattern is !x&y. An expression of this form is almost always
meaningless, because it combines a boolean operator with a bit
operator. In particular, if the rightmost bit of y is 0, the result
will always be 0.
Fixed using coccinelle.
// !x&y combines boolean negation with bitwise and
//
// Confidence: High
// Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2.
// URL: http://www.emn.fr/x-info/coccinelle/rules/notand.html
// Options:
@@ expression E; constant C; @@
(
!E & !C
|
- !E & C
+ !(E & C)
)
* linux/src/drivers/net/tlan.c: Fix bit tests.
* linux/src/drivers/scsi/AM53C974.c: Likewise.
* linux/src/drivers/scsi/FlashPoint.c: Likewise.
* linux/src/drivers/scsi/NCR5380.c: Likewise.
* linux/src/drivers/scsi/t128.c: Likewise.
Diffstat (limited to 'linux/src/drivers/scsi/NCR5380.c')
-rw-r--r-- | linux/src/drivers/scsi/NCR5380.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linux/src/drivers/scsi/NCR5380.c b/linux/src/drivers/scsi/NCR5380.c index 295f2ad2..4f085e9b 100644 --- a/linux/src/drivers/scsi/NCR5380.c +++ b/linux/src/drivers/scsi/NCR5380.c @@ -1949,7 +1949,7 @@ static int do_abort (struct Scsi_Host *host) { * the target sees, so we just handshake. */ - while (!(tmp = NCR5380_read(STATUS_REG)) & SR_REQ); + while (!((tmp = NCR5380_read(STATUS_REG)) & SR_REQ)); NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp)); @@ -2900,7 +2900,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance) { NCR5380_transfer_pio(instance, &phase, &len, &data); - if (!msg[0] & 0x80) { + if (!(msg[0] & 0x80)) { printk("scsi%d : expecting IDENTIFY message, got ", instance->host_no); print_msg(msg); |