Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44194e3e authored by Namhyung Kim's avatar Namhyung Kim Committed by Jens Axboe
Browse files

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: default avatarNamhyung Kim <namhyung@gmail.com>
Acked-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent 80ceb057
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);