dect
/
linux-2.6
Archived
13
0
Fork 0

Staging: rt2860,rt2870: Correct use of ! and &

IW_ENCODE_MODE is 0xF000 and thus !erq->flags & IW_ENCODE_MODE is always 0.
I assume that !(erq->flags & IW_ENCODE_MODE) was intended.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@ expression E; constant C; @@
(
  !E & !C
|
- !E & C
+ !(E & C)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Julia Lawall 2008-12-24 16:24:05 +01:00 committed by Greg Kroah-Hartman
parent 88adc10447
commit 7034ca4dda
2 changed files with 2 additions and 2 deletions

View File

@ -1756,7 +1756,7 @@ int rt_ioctl_siwencode(struct net_device *dev,
}
else
/* Don't complain if only change the mode */
if(!erq->flags & IW_ENCODE_MODE) {
if (!(erq->flags & IW_ENCODE_MODE)) {
return -EINVAL;
}
}

View File

@ -1776,7 +1776,7 @@ int rt_ioctl_siwencode(struct net_device *dev,
}
else
/* Don't complain if only change the mode */
if(!erq->flags & IW_ENCODE_MODE) {
if (!(erq->flags & IW_ENCODE_MODE)) {
return -EINVAL;
}
}