From 5faed5128d3c07f055f96d910529c95814073a09 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Sun, 5 Jan 2014 14:11:29 +0100 Subject: 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. --- linux/src/drivers/net/tlan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linux/src/drivers/net/tlan.c') diff --git a/linux/src/drivers/net/tlan.c b/linux/src/drivers/net/tlan.c index 11e12bb..fedc11f 100644 --- a/linux/src/drivers/net/tlan.c +++ b/linux/src/drivers/net/tlan.c @@ -1132,7 +1132,7 @@ u32 TLan_HandleTxEOF( struct device *dev, u16 host_int ) if ( head_list->cStat & TLAN_CSTAT_EOC ) eoc = 1; - if ( ! head_list->cStat & TLAN_CSTAT_FRM_CMP ) { + if (!(head_list->cStat & TLAN_CSTAT_FRM_CMP)) { printk( "TLAN: Received interrupt for uncompleted TX frame.\n" ); } @@ -1244,7 +1244,7 @@ u32 TLan_HandleRxEOF( struct device *dev, u16 host_int ) eoc = 1; } - if ( ! head_list->cStat & TLAN_CSTAT_FRM_CMP ) { + if (!(head_list->cStat & TLAN_CSTAT_FRM_CMP)) { printk( "TLAN: Received interrupt for uncompleted RX frame.\n" ); } else if ( bbuf ) { skb = dev_alloc_skb( head_list->frameSize + 7 ); -- cgit v1.2.3