diff options
author | Ziyang Zhang <ZiyangZhang@linux.alibaba.com> | 2023-02-07 15:08:37 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-02-07 07:21:31 -0700 |
commit | 731e208d7b4b38d2bac4b7c53403c8abbf306d01 (patch) | |
tree | c2ab7da175883ffa10d3eaacb820a8400d5f4e70 /drivers/block | |
parent | 83e8864fee26f63a7435e941b7c36a20fd6fe93e (diff) |
ublk: remove unnecessary NULL check in ublk_rq_has_data()
bio_has_data() allows a NULL bio so the NULL check in
ublk_rq_has_data() is unnecessary.
Signed-off-by: Ziyang Zhang <ZiyangZhang@linux.alibaba.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20230207070839.370817-2-ZiyangZhang@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/ublk_drv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index c932e9ea5a0f..55fccce68a9c 100644 --- a/drivers/block/ublk_drv.c +++ b/drivers/block/ublk_drv.c @@ -322,7 +322,7 @@ static inline struct ublk_queue *ublk_get_queue(struct ublk_device *dev, static inline bool ublk_rq_has_data(const struct request *rq) { - return rq->bio && bio_has_data(rq->bio); + return bio_has_data(rq->bio); } static inline struct ublksrv_io_desc *ublk_get_iod(struct ublk_queue *ubq, |