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>
             }
         else
                        /* Don't complain if only change the mode */
-                       if(!erq->flags & IW_ENCODE_MODE) {
+                       if (!(erq->flags & IW_ENCODE_MODE)) {
                                return -EINVAL;
                }
        }
 
             }
         else
                        /* Don't complain if only change the mode */
-                       if(!erq->flags & IW_ENCODE_MODE) {
+                       if (!(erq->flags & IW_ENCODE_MODE)) {
                                return -EINVAL;
                }
        }