From: Marcos Paulo de Souza Date: Mon, 14 Jan 2019 13:31:56 +0000 (-0700) Subject: md: Make bio_alloc_mddev use bio_alloc_bioset X-Git-Tag: v5.4-rc1~1718^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6251691a92170d3a781aaf7b5f2c31b50d669809;p=platform%2Fkernel%2Flinux-rpi.git md: Make bio_alloc_mddev use bio_alloc_bioset bio_alloc_bioset returns a bio pointer or NULL, so we can avoid storing the returned data into a new variable. Acked-by: Guoqing Jiang Acked-by: Artur Paszkiewicz Signed-off-by: Marcos Paulo de Souza Signed-off-by: Jens Axboe --- diff --git a/drivers/md/md.c b/drivers/md/md.c index fd4af4d..05ffffb 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -207,15 +207,10 @@ static bool create_on_open = true; struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, struct mddev *mddev) { - struct bio *b; - if (!mddev || !bioset_initialized(&mddev->bio_set)) return bio_alloc(gfp_mask, nr_iovecs); - b = bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set); - if (!b) - return NULL; - return b; + return bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set); } EXPORT_SYMBOL_GPL(bio_alloc_mddev);