Staging: rt2860,rt2870: Correct use of ! and &
authorJulia Lawall <julia@diku.dk>
Wed, 24 Dec 2008 15:24:05 +0000 (16:24 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Apr 2009 21:53:30 +0000 (14:53 -0700)
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>
drivers/staging/rt2860/sta_ioctl.c
drivers/staging/rt2870/sta_ioctl.c

index 3ea2b2c4ab0e6923a3600c000dfa0341cd662567..a9a33e64d8fd7e5759b465b71115f9bdfa0f2c68 100644 (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;
                }
        }
index 91f0fab11313912dd2f05d9afb3c8bc4d234412c..4b432ce4442e7acfb69c40af62182d685d1e6610 100644 (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;
                }
        }