From 44194e3e88fcfe77a2a6e2333847d4f27816259a Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Mon, 20 Jun 2011 13:27:44 +0200 Subject: bsg: remove unnecessary conditional expressions Second condition in OR always implies first condition is false thus bytes_read in the second is not needed. The same goes to bytes_written. Signed-off-by: Namhyung Kim Acked-by: FUJITA Tomonori Signed-off-by: Jens Axboe --- block/bsg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'block/bsg.c') diff --git a/block/bsg.c b/block/bsg.c index c4f49e255751f..b7e42ad553619 100644 --- a/block/bsg.c +++ b/block/bsg.c @@ -606,7 +606,7 @@ bsg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) ret = __bsg_read(buf, count, bd, NULL, &bytes_read); *ppos = bytes_read; - if (!bytes_read || (bytes_read && err_block_err(ret))) + if (!bytes_read || err_block_err(ret)) bytes_read = ret; return bytes_read; @@ -686,7 +686,7 @@ bsg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) /* * return bytes written on non-fatal errors */ - if (!bytes_written || (bytes_written && err_block_err(ret))) + if (!bytes_written || err_block_err(ret)) bytes_written = ret; dprintk("%s: returning %Zd\n", bd->name, bytes_written); -- cgit v1.2.3