linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: Remove unnecessary NULL checks in ext4.
@ 2018-02-06 11:15 Sean Fu
  2018-05-21  2:45 ` Theodore Y. Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Fu @ 2018-02-06 11:15 UTC (permalink / raw)
  To: tytso; +Cc: adilger.kernel, linux-ext4, linux-kernel, Sean Fu

NULL check is done in kmem_cache_destroy. So remove NULL checks in ext4.

Signed-off-by: Sean Fu <fxinrong@gmail.com>
---
 fs/ext4/extents_status.c | 3 +--
 fs/ext4/mballoc.c        | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 763ef18..c4e6fb1 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -162,8 +162,7 @@ int __init ext4_init_es(void)
 
 void ext4_exit_es(void)
 {
-	if (ext4_es_cachep)
-		kmem_cache_destroy(ext4_es_cachep);
+	kmem_cache_destroy(ext4_es_cachep);
 }
 
 void ext4_es_init_tree(struct ext4_es_tree *tree)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index d9f8b90a..4fd1349 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2549,8 +2549,7 @@ static void ext4_groupinfo_destroy_slabs(void)
 	int i;
 
 	for (i = 0; i < NR_GRPINFO_CACHES; i++) {
-		if (ext4_groupinfo_caches[i])
-			kmem_cache_destroy(ext4_groupinfo_caches[i]);
+		kmem_cache_destroy(ext4_groupinfo_caches[i]);
 		ext4_groupinfo_caches[i] = NULL;
 	}
 }
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ext4: Remove unnecessary NULL checks in ext4.
  2018-02-06 11:15 [PATCH] ext4: Remove unnecessary NULL checks in ext4 Sean Fu
@ 2018-05-21  2:45 ` Theodore Y. Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Y. Ts'o @ 2018-05-21  2:45 UTC (permalink / raw)
  To: Sean Fu; +Cc: adilger.kernel, linux-ext4, linux-kernel

On Tue, Feb 06, 2018 at 07:15:30PM +0800, Sean Fu wrote:
> NULL check is done in kmem_cache_destroy. So remove NULL checks in ext4.
> 
> Signed-off-by: Sean Fu <fxinrong@gmail.com>

Thanks, applied.  I clarified the patch summary to be:

    ext4: remove NULL check before calling kmem_cache_destroy()

    	  	      	    	   	   - Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-21  2:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-06 11:15 [PATCH] ext4: Remove unnecessary NULL checks in ext4 Sean Fu
2018-05-21  2:45 ` Theodore Y. Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).