summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorChangcheng Deng <deng.changcheng@zte.com.cn>2021-10-20 11:49:48 +0300
committerJens Axboe <axboe@kernel.dk>2021-10-20 17:02:35 +0300
commit898df2447b9ee8d759e85d33087505d3905bf2f0 (patch)
tree14aab37a126cd6d4f2af3dbcd3a82d3cef3376e6 /fs
parent3b44b3712c5b19b0af11c25cd978abdc3680d5e7 (diff)
downloadlinux-898df2447b9ee8d759e85d33087505d3905bf2f0.tar.xz
io_uring: Use ERR_CAST() instead of ERR_PTR(PTR_ERR())
Use ERR_CAST() instead of ERR_PTR(PTR_ERR()). This makes it more readable and also fix this warning detected by err_cast.cocci: ./fs/io_uring.c: WARNING: 3208: 11-18: ERR_CAST can be used with buf Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn> Link: https://lore.kernel.org/r/20211020084948.1038420-1-deng.changcheng@zte.com.cn Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index c87931d8b503..88c5ee4dc242 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3172,7 +3172,7 @@ static struct iovec *__io_import_iovec(int rw, struct io_kiocb *req,
if (req->flags & REQ_F_BUFFER_SELECT) {
buf = io_rw_buffer_select(req, &sqe_len, issue_flags);
if (IS_ERR(buf))
- return ERR_PTR(PTR_ERR(buf));
+ return ERR_CAST(buf);
req->rw.len = sqe_len;
}