block: remove unnecessary NULL checks in bioset_integrity_free()
PATCH 1/1 block: remove unnecessary NULL checks in bioset_integrity_free()
mempool_destroy() already checks for a NULL value being passed in, this eliminates duplicate checks.
This was caught by running make coccicheck M=block/ on linus' tree on commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of this patch).
--- block/bio-integrity.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
block/bio-integrity.c +2 -5
@@ -485,11 +485,8 @@ EXPORT_SYMBOL(bioset_integrity_create);void bioset_integrity_free (struct bio_set *bs) { -if (bs->bio_integrity_pool) -mempool_destroy (bs->bio_integrity_pool); - -if (bs->bvec_integrity_pool) -mempool_destroy (bs->bvec_integrity_pool); +mempool_destroy (bs->bio_integrity_pool); +mempool_destroy (bs->bvec_integrity_pool); }EXPORT_SYMBOL (bioset_integrity_free);
Signature · 1 line
2.1.4
Hi Tim,
Quoted 2 lines · Tim Hansen
=20
mempool_destroy()already checks for a NULL value being passed in, =
this eliminates duplicate checks.
Quoted 2 lines
=20
This was caught by running make coccicheck M=3Dblock/ on linus' tree =
on commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of = this patch).
Quoted 21 lines
=20
Signed-off-by Tim Hansen <[email protected]>---
block/bio-integrity.c| 7 ++-----1 file changed, 2 insertions(+), 5 deletions(-)=20
block/bio-integrity.c +0
-0@@ -485,11 +485,8 @@ EXPORT_SYMBOL(bioset_integrity_create);=20
voidbioset_integrity_free(struct bio_set *bs)
{block/bio-integrity.c +2
-5-if (bs->bio_integrity_pool) -mempool_destroy (bs->bio_integrity_pool); - -if (bs->bvec_integrity_pool) -mempool_destroy (bs->bvec_integrity_pool); +mempool_destroy (bs->bio_integrity_pool); +mempool_destroy (bs->bvec_integrity_pool);
Quoted 5 lines
}
EXPORT_SYMBOL(bioset_integrity_free);
=20
--=20
2.1.4
Looks good.
Tim,
Quoted 2 lines
mempool_destroy()already checks for a NULL value being passed in, this eliminates duplicate checks.
That's fine.
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Quoted 3 lines · Tim Hansen
mempool_destroy()already checks for a NULL value being passed in, this eliminates duplicate checks.This was caught by running make coccicheck M=block/ on linus' tree on commit
77ede3a014a32746002f7889211f0cecf4803163(current head as of this patch).
Applied, but I had to fix up your commit message. Please line wrap at 72 chars, otherwise it turns into an unreadable mess when people try to view them.
Signature · 1 line
Jens Axboe
Quoted 12 lines · Jens Axboe
Quoted 3 lines · Tim Hansen
mempool_destroy()already checks for a NULL value being passed in, this eliminates duplicate checks.This was caught by running make coccicheck M=block/ on linus' tree on commit
77ede3a014a32746002f7889211f0cecf4803163(current head as of this patch).Applied, but I had to fix up your commit message. Please line wrap at 72 chars, otherwise it turns into an unreadable mess when people try to view them.
Signature · 1 line
Jens Axboe
Noted! Thanks for the heads up on the char limit.
Quoted 3 lines · Tim Hansen
Quoted 2 lines · Jens Axboe
Quoted 1 line · Tim Hansen
mempool_destroy()already checks for a NULL value being passed in, =
this eliminates duplicate checks.
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
=20
This was caught by running make coccicheck M=3Dblock/ on linus' tree =
on commit 77ede3a014a32746002f7889211f0cecf4803163 (current head as of = this patch).
Quoted 10 lines
Quoted 8 lines
=20
Applied, but I had to fix up your commit message. Please line wrap at 72 chars, otherwise it turns into an unreadable mess when people try to view them.
=20
--=20
Jens Axboe
=20=20
Noted! Thanks for the heads up on the char limit.
scripts/checkpatch.pl would have caught it too
--
Kyle Fortin - Oracle Linux Engineering