Commit 96cf2f54 authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe

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: default avatarZiyang Zhang <ZiyangZhang@linux.alibaba.com>
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2f3af723
...@@ -298,9 +298,7 @@ static inline bool ublk_can_use_task_work(const struct ublk_queue *ubq) ...@@ -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) static inline bool ublk_need_get_data(const struct ublk_queue *ubq)
{ {
if (ubq->flags & UBLK_F_NEED_GET_DATA) return ubq->flags & UBLK_F_NEED_GET_DATA;
return true;
return false;
} }
static struct ublk_device *ublk_get_device(struct ublk_device *ub) 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) ...@@ -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( static inline bool ublk_queue_can_use_recovery_reissue(
struct ublk_queue *ubq) struct ublk_queue *ubq)
{ {
if ((ubq->flags & UBLK_F_USER_RECOVERY) && return (ubq->flags & UBLK_F_USER_RECOVERY) &&
(ubq->flags & UBLK_F_USER_RECOVERY_REISSUE)) (ubq->flags & UBLK_F_USER_RECOVERY_REISSUE);
return true;
return false;
} }
static inline bool ublk_queue_can_use_recovery( static inline bool ublk_queue_can_use_recovery(
struct ublk_queue *ubq) struct ublk_queue *ubq)
{ {
if (ubq->flags & UBLK_F_USER_RECOVERY) return ubq->flags & UBLK_F_USER_RECOVERY;
return true;
return false;
} }
static inline bool ublk_can_use_recovery(struct ublk_device *ub) static inline bool ublk_can_use_recovery(struct ublk_device *ub)
{ {
if (ub->dev_info.flags & UBLK_F_USER_RECOVERY) return ub->dev_info.flags & UBLK_F_USER_RECOVERY;
return true;
return false;
} }
static void ublk_free_disk(struct gendisk *disk) static void ublk_free_disk(struct gendisk *disk)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment