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

Commit 47255491 authored by zhong jiang's avatar zhong jiang Committed by Jens Axboe
Browse files

block/bsg-lib: use PTR_ERR_OR_ZERO to simplify the flow path



Simplify the code by using the PTR_ERR_OR_ZERO, instead of the
open code. It is better.

Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarzhong jiang <zhongjiang@huawei.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 08fcf813
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -48,9 +48,8 @@ static int bsg_transport_fill_hdr(struct request *rq, struct sg_io_v4 *hdr,

	job->request_len = hdr->request_len;
	job->request = memdup_user(uptr64(hdr->request), hdr->request_len);
	if (IS_ERR(job->request))
		return PTR_ERR(job->request);
	return 0;

	return PTR_ERR_OR_ZERO(job->request);
}

static int bsg_transport_complete_rq(struct request *rq, struct sg_io_v4 *hdr)