[PATCH] block: remove the boring judgment in blk_rq_map_bio_alloc()

Chaohai Chen posted 1 patch 3 weeks, 1 day ago
block/blk-map.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
[PATCH] block: remove the boring judgment in blk_rq_map_bio_alloc()
Posted by Chaohai Chen 3 weeks, 1 day ago
There is no need to check the return value of bio_alloc_bioset().

Signed-off-by: Chaohai Chen <wdhh6@aliyun.com>
---
 block/blk-map.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/block/blk-map.c b/block/blk-map.c
index 4533094d9458..f95b07ec3b88 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -46,14 +46,8 @@ static struct bio *blk_rq_map_bio_alloc(struct request *rq,
 		unsigned int nr_vecs, gfp_t gfp_mask)
 {
 	struct block_device *bdev = rq->q->disk ? rq->q->disk->part0 : NULL;
-	struct bio *bio;
 
-	bio = bio_alloc_bioset(bdev, nr_vecs, rq->cmd_flags, gfp_mask,
-				&fs_bio_set);
-	if (!bio)
-		return NULL;
-
-	return bio;
+	return bio_alloc_bioset(bdev, nr_vecs, rq->cmd_flags, gfp_mask, &fs_bio_set);
 }
 
 /**
-- 
2.43.7
Re: [PATCH] block: remove the boring judgment in blk_rq_map_bio_alloc()
Posted by Jens Axboe 3 weeks, 1 day ago
https://lore.kernel.org/all/2d73aaa4-9718-4285-ab3f-85e1fa3b40fa@kernel.dk/

-- 
Jens Axboe