From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755371AbbIMM2c (ORCPT ); Sun, 13 Sep 2015 08:28:32 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:50399 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754288AbbIMM0L (ORCPT ); Sun, 13 Sep 2015 08:26:11 -0400 X-IronPort-AV: E=Sophos;i="5.17,522,1437429600"; d="scan'208";a="145607458" From: Julia Lawall To: Steven Whitehouse Cc: sergey.senozhatsky@gmail.com, kernel-janitors@vger.kernel.org, Bob Peterson , cluster-devel@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH 35/39] GFS2: drop null test before destroy functions Date: Sun, 13 Sep 2015 14:15:28 +0200 Message-Id: <1442146532-9100-36-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1442146532-9100-1-git-send-email-Julia.Lawall@lip6.fr> References: <1442146532-9100-1-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove unneeded NULL test. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ -if (x != NULL) \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); // Signed-off-by: Julia Lawall --- fs/gfs2/main.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index 241a399..4d78c3e 100644 --- a/fs/gfs2/main.c +++ b/fs/gfs2/main.c @@ -192,28 +192,13 @@ fail: fail_lru: unregister_shrinker(&gfs2_qd_shrinker); gfs2_glock_exit(); - - if (gfs2_rsrv_cachep) - kmem_cache_destroy(gfs2_rsrv_cachep); - - if (gfs2_quotad_cachep) - kmem_cache_destroy(gfs2_quotad_cachep); - - if (gfs2_rgrpd_cachep) - kmem_cache_destroy(gfs2_rgrpd_cachep); - - if (gfs2_bufdata_cachep) - kmem_cache_destroy(gfs2_bufdata_cachep); - - if (gfs2_inode_cachep) - kmem_cache_destroy(gfs2_inode_cachep); - - if (gfs2_glock_aspace_cachep) - kmem_cache_destroy(gfs2_glock_aspace_cachep); - - if (gfs2_glock_cachep) - kmem_cache_destroy(gfs2_glock_cachep); - + kmem_cache_destroy(gfs2_rsrv_cachep); + kmem_cache_destroy(gfs2_quotad_cachep); + kmem_cache_destroy(gfs2_rgrpd_cachep); + kmem_cache_destroy(gfs2_bufdata_cachep); + kmem_cache_destroy(gfs2_inode_cachep); + kmem_cache_destroy(gfs2_glock_aspace_cachep); + kmem_cache_destroy(gfs2_glock_cachep); gfs2_sys_uninit(); return error; } From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Date: Sun, 13 Sep 2015 12:15:28 +0000 Subject: [PATCH 35/39] GFS2: drop null test before destroy functions Message-Id: <1442146532-9100-36-git-send-email-Julia.Lawall@lip6.fr> List-Id: References: <1442146532-9100-1-git-send-email-Julia.Lawall@lip6.fr> In-Reply-To: <1442146532-9100-1-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Steven Whitehouse Cc: sergey.senozhatsky@gmail.com, kernel-janitors@vger.kernel.org, Bob Peterson , cluster-devel@redhat.com, linux-kernel@vger.kernel.org Remove unneeded NULL test. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ -if (x != NULL) \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); // Signed-off-by: Julia Lawall --- fs/gfs2/main.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index 241a399..4d78c3e 100644 --- a/fs/gfs2/main.c +++ b/fs/gfs2/main.c @@ -192,28 +192,13 @@ fail: fail_lru: unregister_shrinker(&gfs2_qd_shrinker); gfs2_glock_exit(); - - if (gfs2_rsrv_cachep) - kmem_cache_destroy(gfs2_rsrv_cachep); - - if (gfs2_quotad_cachep) - kmem_cache_destroy(gfs2_quotad_cachep); - - if (gfs2_rgrpd_cachep) - kmem_cache_destroy(gfs2_rgrpd_cachep); - - if (gfs2_bufdata_cachep) - kmem_cache_destroy(gfs2_bufdata_cachep); - - if (gfs2_inode_cachep) - kmem_cache_destroy(gfs2_inode_cachep); - - if (gfs2_glock_aspace_cachep) - kmem_cache_destroy(gfs2_glock_aspace_cachep); - - if (gfs2_glock_cachep) - kmem_cache_destroy(gfs2_glock_cachep); - + kmem_cache_destroy(gfs2_rsrv_cachep); + kmem_cache_destroy(gfs2_quotad_cachep); + kmem_cache_destroy(gfs2_rgrpd_cachep); + kmem_cache_destroy(gfs2_bufdata_cachep); + kmem_cache_destroy(gfs2_inode_cachep); + kmem_cache_destroy(gfs2_glock_aspace_cachep); + kmem_cache_destroy(gfs2_glock_cachep); gfs2_sys_uninit(); return error; } From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julia Lawall Date: Sun, 13 Sep 2015 14:15:28 +0200 Subject: [Cluster-devel] [PATCH 35/39] GFS2: drop null test before destroy functions In-Reply-To: <1442146532-9100-1-git-send-email-Julia.Lawall@lip6.fr> References: <1442146532-9100-1-git-send-email-Julia.Lawall@lip6.fr> Message-ID: <1442146532-9100-36-git-send-email-Julia.Lawall@lip6.fr> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Remove unneeded NULL test. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; @@ -if (x != NULL) \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x); // Signed-off-by: Julia Lawall --- fs/gfs2/main.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c index 241a399..4d78c3e 100644 --- a/fs/gfs2/main.c +++ b/fs/gfs2/main.c @@ -192,28 +192,13 @@ fail: fail_lru: unregister_shrinker(&gfs2_qd_shrinker); gfs2_glock_exit(); - - if (gfs2_rsrv_cachep) - kmem_cache_destroy(gfs2_rsrv_cachep); - - if (gfs2_quotad_cachep) - kmem_cache_destroy(gfs2_quotad_cachep); - - if (gfs2_rgrpd_cachep) - kmem_cache_destroy(gfs2_rgrpd_cachep); - - if (gfs2_bufdata_cachep) - kmem_cache_destroy(gfs2_bufdata_cachep); - - if (gfs2_inode_cachep) - kmem_cache_destroy(gfs2_inode_cachep); - - if (gfs2_glock_aspace_cachep) - kmem_cache_destroy(gfs2_glock_aspace_cachep); - - if (gfs2_glock_cachep) - kmem_cache_destroy(gfs2_glock_cachep); - + kmem_cache_destroy(gfs2_rsrv_cachep); + kmem_cache_destroy(gfs2_quotad_cachep); + kmem_cache_destroy(gfs2_rgrpd_cachep); + kmem_cache_destroy(gfs2_bufdata_cachep); + kmem_cache_destroy(gfs2_inode_cachep); + kmem_cache_destroy(gfs2_glock_aspace_cachep); + kmem_cache_destroy(gfs2_glock_cachep); gfs2_sys_uninit(); return error; }