Staging: Correct use of ! and &
authorJulia Lawall <julia@diku.dk>
Mon, 27 Jul 2009 19:59:48 +0000 (21:59 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Sep 2009 19:02:06 +0000 (12:02 -0700)
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>
drivers/staging/rt3090/sta_ioctl.c
drivers/staging/vt6656/iwctl.c

index 93efd7f5bf3fd7f53171b1d0b3feb9a67aa15488..b8ab84a0469b3e103a74cad768e7ec278fb8e387 100644 (file)
@@ -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:
index e4fdb6fc6eab14858f443ddbaf96125c1d930014..96f2a78994be03c1266ea3b634ccd1f1459e745a 100644 (file)
@@ -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;
            }