diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2019-01-14 06:31:56 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-01-14 06:31:56 -0700 |
commit | 6251691a92170d3a781aaf7b5f2c31b50d669809 (patch) | |
tree | 9b09f6724ff0ca0dd8b87698bde414946bdd4511 /drivers | |
parent | 5bf859081f6a7575a3f7509d7a70d0a9baa88ce3 (diff) | |
download | linux-stable-6251691a92170d3a781aaf7b5f2c31b50d669809.tar.gz linux-stable-6251691a92170d3a781aaf7b5f2c31b50d669809.tar.bz2 linux-stable-6251691a92170d3a781aaf7b5f2c31b50d669809.zip |
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 <gqjiang@suse.com>
Acked-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/md.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index fd4af4de03b4..05ffffb8b769 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); |