diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-01-05 14:22:15 +0100 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-01-05 14:22:15 +0100 |
commit | e013a9371d567af6504ed38befb6e866faf7afe7 (patch) | |
tree | 5270b4cc9786ae124d28cb169eae335d9796b9a0 /ddb/db_expr.h | |
parent | 5faed5128d3c07f055f96d910529c95814073a09 (diff) |
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 E1,E2; @@
(
!E1 & !E2
|
- !E1 & E2
+ !(E1 & E2)
)
* linux/src/drivers/scsi/FlashPoint.c: Fix bit tests.
Diffstat (limited to 'ddb/db_expr.h')
0 files changed, 0 insertions, 0 deletions