ublk: return unsigned from ublk_{,un}map_io()
Subsystems (2)
PATCH 1/1 ublk: return unsigned from ublk_{,un}map_io()
ublk_map_io() and ublk_unmap_io() never return negative values, and their return values are stored in variables of type unsigned. Clarify that they can't fail by making their return types unsigned.
Signed-off-by Caleb Sander Mateos <[email protected]>
--- drivers/block/ublk_drv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/block/ublk_drv.c +4 -3
@@ -961,12 +961,13 @@ static inline bool ublk_need_unmap_req(const struct request *req) {return ublk_rq_has_data (req) && (req_op (req) ==REQ_OP_READ ||req_op (req) ==REQ_OP_DRV_IN ); } -static int ublk_map_io (const struct ublk_queue *ubq,const struct request *req, -const struct ublk_io *io) +static unsigned int ublk_map_io (const struct ublk_queue *ubq, +const struct request *req, +const struct ublk_io *io) {const unsigned int rq_bytes =blk_rq_bytes (req);if (!ublk_need_map_io (ubq))return rq_bytes;
@@ -984,11 +985,11 @@ static int ublk_map_io(const struct ublk_queue *ubq, const struct request *req,return ublk_copy_user_pages (req,0 , &iter, dir); }return rq_bytes; } -static int ublk_unmap_io (bool need_map, +static unsigned int ublk_unmap_io (bool need_map,const struct request *req,const struct ublk_io *io) {const unsigned int rq_bytes =blk_rq_bytes (req);
Signature · 1 line
2.45.2
Quoted 6 lines · Caleb Sander Mateos
ublk_map_io()andublk_unmap_io()never return negative values, and their return values are stored in variables of type unsigned. Clarify that they can't fail by making their return types unsigned.Signed-off-by Caleb Sander Mateos <[email protected]>
Reviewed-by Ming Lei <[email protected]>
Quoted 5 lines · Caleb Sander Mateos
ublk_map_io()andublk_unmap_io()never return negative values, and their return values are stored in variables of type unsigned. Clarify that they can't fail by making their return types unsigned.
Applied, thanks!
[1/1] ublk: return unsigned from ublk_{,un}map_io()
commit: 727a44027815aea13d34c28254d386562efc3bab
Best regards,
Signature · 1 line
Jens Axboe