From: Ziyang Zhang Date: Tue, 7 Feb 2023 07:08:37 +0000 (+0800) Subject: ublk: remove unnecessary NULL check in ublk_rq_has_data() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=731e208d7b4b38d2bac4b7c53403c8abbf306d01;p=linux.git 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 Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20230207070839.370817-2-ZiyangZhang@linux.alibaba.com Signed-off-by: Jens Axboe --- diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c index c932e9ea5a0ff..55fccce68a9cc 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,