diff options
author | Ming Lei <ming.lei@redhat.com> | 2023-03-30 13:36:23 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-04-03 03:22:55 +0200 |
commit | 96cf2f5404c8bc979628a2b495852d735a56c5b5 (patch) | |
tree | dd590971ee3fc58fbb44f7b606bb57c81e016ae8 /drivers/block/ublk_drv.c | |
parent | block: ublk_drv: add two helpers to clean up map/unmap request (diff) | |
download | linux-96cf2f5404c8bc979628a2b495852d735a56c5b5.tar.xz linux-96cf2f5404c8bc979628a2b495852d735a56c5b5.zip |
block: ublk_drv: clean up several helpers
Convert the following pattern in several helpers
if (Z)
return true
return false
into:
return Z;
Reviewed-by: Ziyang Zhang <ZiyangZhang@linux.alibaba.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r-- | drivers/block/ublk_drv.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index 439bd5773715..a40edc437c9f 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -298,9 +298,7 @@ static inline bool ublk_can_use_task_work(const struct ublk_queue *ubq) static inline bool ublk_need_get_data(const struct ublk_queue *ubq) { - if (ubq->flags & UBLK_F_NEED_GET_DATA) - return true; - return false; + return ubq->flags & UBLK_F_NEED_GET_DATA; } static struct ublk_device *ublk_get_device(struct ublk_device *ub) @@ -349,25 +347,19 @@ static inline int ublk_queue_cmd_buf_size(struct ublk_device *ub, int q_id) static inline bool ublk_queue_can_use_recovery_reissue( struct ublk_queue *ubq) { - if ((ubq->flags & UBLK_F_USER_RECOVERY) && - (ubq->flags & UBLK_F_USER_RECOVERY_REISSUE)) - return true; - return false; + return (ubq->flags & UBLK_F_USER_RECOVERY) && + (ubq->flags & UBLK_F_USER_RECOVERY_REISSUE); } static inline bool ublk_queue_can_use_recovery( struct ublk_queue *ubq) { - if (ubq->flags & UBLK_F_USER_RECOVERY) - return true; - return false; + return ubq->flags & UBLK_F_USER_RECOVERY; } static inline bool ublk_can_use_recovery(struct ublk_device *ub) { - if (ub->dev_info.flags & UBLK_F_USER_RECOVERY) - return true; - return false; + return ub->dev_info.flags & UBLK_F_USER_RECOVERY; } static void ublk_free_disk(struct gendisk *disk) |