Skip to content

Commit

Permalink
Staging: rt2860,rt2870: Correct use of ! and &
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent 88adc10 commit 7034ca4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/rt2860/sta_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/rt2870/sta_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 7034ca4

Please sign in to comment.