USB: skeleton: Correct use of ! and &
authorJulia Lawall <julia@diku.dk>
Sat, 19 Sep 2009 07:13:43 +0000 (09:13 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Dec 2009 19:55:14 +0000 (11:55 -0800)
Correct priority problem in the use of ! and &.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <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/usb/usb-skeleton.c

index b62f2bc064f695f732696dea3d5fd54d450e2704..b1e579c5c97cbb90bc19be3619d41aaee1f8e6f4 100644 (file)
@@ -358,7 +358,7 @@ retry:
                rv = skel_do_read_io(dev, count);
                if (rv < 0)
                        goto exit;
-               else if (!file->f_flags & O_NONBLOCK)
+               else if (!(file->f_flags & O_NONBLOCK))
                        goto retry;
                rv = -EAGAIN;
        }
@@ -411,7 +411,7 @@ static ssize_t skel_write(struct file *file, const char *user_buffer,
         * limit the number of URBs in flight to stop a user from using up all
         * RAM
         */
-       if (!file->f_flags & O_NONBLOCK) {
+       if (!(file->f_flags & O_NONBLOCK)) {
                if (down_interruptible(&dev->limit_sem)) {
                        retval = -ERESTARTSYS;
                        goto exit;