Skip to content

Commit

Permalink
fs/direct-io.c: adjust suspicious bit operation
Browse files Browse the repository at this point in the history
READ is 0, so the result of the bit-and operation is 0.  Rewrite with == as
done elsewhere in the same file.

This problem was found using Coccinelle (http://coccinelle.lip6.fr/).

Signed-off-by: Julia Lawall <julia@diku.dk>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
JuliaLawall authored and Al Viro committed Jul 14, 2012
1 parent 3dd8478 commit d187663
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/direct-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ do_blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
*/
BUG_ON(retval == -EIOCBQUEUED);
if (dio->is_async && retval == 0 && dio->result &&
((rw & READ) || (dio->result == sdio.size)))
((rw == READ) || (dio->result == sdio.size)))
retval = -EIOCBQUEUED;

if (retval != -EIOCBQUEUED)
Expand Down

0 comments on commit d187663

Please sign in to comment.