diff mbox

block/bio: Remove null checks before mempool_destroy in bioset_free

Message ID 20171006184513.GA78611@debian (mailing list archive)
State New, archived
Headers show

Commit Message

Tim Hansen Oct. 6, 2017, 6:45 p.m. UTC
This patch removes redundant checks for null values on bio_pool and bvec_pool.

Found using make coccicheck M=block/ on linux-net tree on the next-20170929 tag.

Related to patch 9987695 that removed similar checks in bio-integrity. 

Signed-off-by: Tim Hansen <devtimhansen@gmail.com>
---
 block/bio.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Jens Axboe Oct. 6, 2017, 7:05 p.m. UTC | #1
On 10/06/2017 12:45 PM, Tim Hansen wrote:
> This patch removes redundant checks for null values on bio_pool and bvec_pool.
> 
> Found using make coccicheck M=block/ on linux-net tree on the next-20170929 tag.
> 
> Related to patch 9987695 that removed similar checks in bio-integrity. 

Applied, but ditto on the line length. Additionally, I killed that reference
to "patch 9987695", I don't know what that means? What does that refer to?
Tim Hansen Oct. 6, 2017, 10:30 p.m. UTC | #2
On Fri, Oct 06, 2017 at 01:05:01PM -0600, Jens Axboe wrote:
> On 10/06/2017 12:45 PM, Tim Hansen wrote:
> > This patch removes redundant checks for null values on bio_pool and bvec_pool.
> > 
> > Found using make coccicheck M=block/ on linux-net tree on the next-20170929 tag.
> > 
> > Related to patch 9987695 that removed similar checks in bio-integrity. 
> 
> Applied, but ditto on the line length. Additionally, I killed that reference
> to "patch 9987695", I don't know what that means? What does that refer to?
> 
> -- 
> Jens Axboe
> 

The patch number I referenced is what is used on patchwork.com to
reference a patch under review.  I'll leave that out in the next message.
What is the proper manner of referencing another patch thats still in 
review?
diff mbox

Patch

diff --git a/block/bio.c b/block/bio.c
index 8338304..bf0dbe8 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1928,11 +1928,8 @@  void bioset_free(struct bio_set *bs)
 	if (bs->rescue_workqueue)
 		destroy_workqueue(bs->rescue_workqueue);
 
-	if (bs->bio_pool)
-		mempool_destroy(bs->bio_pool);
-
-	if (bs->bvec_pool)
-		mempool_destroy(bs->bvec_pool);
+	mempool_destroy(bs->bio_pool);
+	mempool_destroy(bs->bvec_pool);
 
 	bioset_integrity_free(bs);
 	bio_put_slab(bs);