Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1223627 > unrolled thread

[PATCH 01/39] mtd: nandsim: drop null test before destroy functions

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2015-09-13 14:30 +0200
Last post2015-09-22 02:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 01/39] mtd: nandsim: drop null test before destroy functions Julia Lawall <Julia.Lawall@lip6.fr> - 2015-09-13 14:30 +0200
    Re: [PATCH 01/39] mtd: nandsim: drop null test before destroy  functions Brian Norris <computersforpeace@gmail.com> - 2015-09-22 02:10 +0200

#1223627 — [PATCH 01/39] mtd: nandsim: drop null test before destroy functions

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2015-09-13 14:30 +0200
Subject[PATCH 01/39] mtd: nandsim: drop null test before destroy functions
Message-ID<q8ezT-7xJ-7@gated-at.bofh.it>
Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mtd/nand/nandsim.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index 95d0cc4..b16d70a 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -649,8 +649,7 @@ static void free_device(struct nandsim *ns)
 				kmem_cache_free(ns->nand_pages_slab,
 						ns->pages[i].byte);
 		}
-		if (ns->nand_pages_slab)
-			kmem_cache_destroy(ns->nand_pages_slab);
+		kmem_cache_destroy(ns->nand_pages_slab);
 		vfree(ns->pages);
 	}
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1229854 — Re: [PATCH 01/39] mtd: nandsim: drop null test before destroy functions

FromBrian Norris <computersforpeace@gmail.com>
Date2015-09-22 02:10 +0200
SubjectRe: [PATCH 01/39] mtd: nandsim: drop null test before destroy functions
Message-ID<qbjjH-5xz-5@gated-at.bofh.it>
In reply to#1223627
On Sun, Sep 13, 2015 at 02:14:54PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied patches 1 and 36 to l2-mtd.git
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web