提交 4de84057 编写于 作者: J Julia Lawall 提交者: Greg Kroah-Hartman

USB: skeleton: Correct use of ! and &

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: NJulia Lawall <julia@diku.dk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 f0ad073f
...@@ -358,7 +358,7 @@ static ssize_t skel_read(struct file *file, char *buffer, size_t count, ...@@ -358,7 +358,7 @@ static ssize_t skel_read(struct file *file, char *buffer, size_t count,
rv = skel_do_read_io(dev, count); rv = skel_do_read_io(dev, count);
if (rv < 0) if (rv < 0)
goto exit; goto exit;
else if (!file->f_flags & O_NONBLOCK) else if (!(file->f_flags & O_NONBLOCK))
goto retry; goto retry;
rv = -EAGAIN; rv = -EAGAIN;
} }
...@@ -411,7 +411,7 @@ static ssize_t skel_write(struct file *file, const char *user_buffer, ...@@ -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 * limit the number of URBs in flight to stop a user from using up all
* RAM * RAM
*/ */
if (!file->f_flags & O_NONBLOCK) { if (!(file->f_flags & O_NONBLOCK)) {
if (down_interruptible(&dev->limit_sem)) { if (down_interruptible(&dev->limit_sem)) {
retval = -ERESTARTSYS; retval = -ERESTARTSYS;
goto exit; goto exit;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册