Skip to content

Commit

Permalink
USB: skeleton: 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://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>
  • Loading branch information
Julia Lawall authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent f0ad073 commit 4de8405
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/usb-skeleton.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ static ssize_t skel_read(struct file *file, char *buffer, size_t count,
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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4de8405

Please sign in to comment.