From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Tue, 19 Jul 2016 21:08:24 +0000 Subject: Re: [PATCH] sh-DWARF: Delete unnecessary checks before the function call "mempool_destroy" Message-Id: List-Id: References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <564985B7.3080806@users.sourceforge.net> In-Reply-To: <564985B7.3080806@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Rich Felker , Yoshinori Sato , linux-sh@vger.kernel.org Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall , David Rientjes > From: Markus Elfring > Date: Mon, 16 Nov 2015 08:20:36 +0100 > > The mempool_destroy() function tests whether its argument is NULL > and then returns immediately. Thus the test around the calls is not needed. > > This issue was detected by using the Coccinelle software. > > Signed-off-by: Markus Elfring > --- > arch/sh/kernel/dwarf.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c > index 9d209a0..e1d751a 100644 > --- a/arch/sh/kernel/dwarf.c > +++ b/arch/sh/kernel/dwarf.c > @@ -1009,10 +1009,8 @@ static void __init dwarf_unwinder_cleanup(void) > rbtree_postorder_for_each_entry_safe(cie, next_cie, &cie_root, node) > kfree(cie); > > - if (dwarf_reg_pool) > - mempool_destroy(dwarf_reg_pool); > - if (dwarf_frame_pool) > - mempool_destroy(dwarf_frame_pool); > + mempool_destroy(dwarf_reg_pool); > + mempool_destroy(dwarf_frame_pool); > kmem_cache_destroy(dwarf_reg_cachep); > kmem_cache_destroy(dwarf_frame_cachep); > } > Would you like to integrate this update suggestion into another source code repository? Regards, Markus