projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
08fcf81
)
block/bsg-lib: use PTR_ERR_OR_ZERO to simplify the flow path
author
zhong jiang
<
[email protected]
>
Tue, 31 Jul 2018 16:13:14 +0000
(
00:13
+0800)
committer
Jens Axboe
<
[email protected]
>
Wed, 1 Aug 2018 15:13:03 +0000
(09:13 -0600)
Simplify the code by using the PTR_ERR_OR_ZERO, instead of the
open code. It is better.
Reviewed-by: Johannes Thumshirn <
[email protected]
>
Signed-off-by: zhong jiang <
[email protected]
>
Signed-off-by: Jens Axboe <
[email protected]
>
block/bsg-lib.c
patch
|
blob
|
history
diff --git
a/block/bsg-lib.c
b/block/bsg-lib.c
index 9419def8c0175591a7a09739b3f8c64e9035357f..f3501cdaf1a654ab0cb2c1674304c8a30f5291e3 100644
(file)
--- a/
block/bsg-lib.c
+++ b/
block/bsg-lib.c
@@
-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)