Skip to content

Commit

Permalink
Staging: Correct use of ! and &
Browse files Browse the repository at this point in the history
Correct priority problem in the use of ! and &.

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)
// </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 Sep 15, 2009
1 parent 658ce9d commit 2e9ab1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions drivers/staging/rt3090/sta_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1840,10 +1840,8 @@ int rt_ioctl_siwencode(struct net_device *dev,
}
else
/* Don't complain if only change the mode */
if(!erq->flags & IW_ENCODE_MODE)
{
return -EINVAL;
}
if (!(erq->flags & IW_ENCODE_MODE))
return -EINVAL;
}

done:
Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/vt6656/iwctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1409,8 +1409,7 @@ int iwctl_siwencode(struct net_device *dev,
// Do we want to just set the transmit key index ?
if ( index < 4 ) {
pDevice->byKeyIndex = index;
}
else if(!wrq->flags & IW_ENCODE_MODE) {
} else if (!(wrq->flags & IW_ENCODE_MODE)) {
rc = -EINVAL;
return rc;
}
Expand Down

0 comments on commit 2e9ab1e

Please sign in to comment.