From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750998AbbJCSg2 (ORCPT ); Sat, 3 Oct 2015 14:36:28 -0400 Received: from a.ns.miles-group.at ([95.130.255.143]:11949 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750750AbbJCSg1 (ORCPT ); Sat, 3 Oct 2015 14:36:27 -0400 Subject: Re: [PATCH 23/39] UBI: drop null test before destroy functions To: Julia Lawall , Artem Bityutskiy References: <1442146532-9100-1-git-send-email-Julia.Lawall@lip6.fr> <1442146532-9100-24-git-send-email-Julia.Lawall@lip6.fr> Cc: sergey.senozhatsky@gmail.com, kernel-janitors@vger.kernel.org, David Woodhouse , Brian Norris , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org From: Richard Weinberger Message-ID: <56102028.70501@nod.at> Date: Sat, 3 Oct 2015 20:36:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1442146532-9100-24-git-send-email-Julia.Lawall@lip6.fr> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 13.09.2015 um 14:15 schrieb Julia Lawall: > 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 > > --- > drivers/mtd/ubi/attach.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c > index 68eea5b..c1aaf03 100644 > --- a/drivers/mtd/ubi/attach.c > +++ b/drivers/mtd/ubi/attach.c > @@ -1209,9 +1209,7 @@ static void destroy_ai(struct ubi_attach_info *ai) > } > } > > - if (ai->aeb_slab_cache) > - kmem_cache_destroy(ai->aeb_slab_cache); > - > + kmem_cache_destroy(ai->aeb_slab_cache); > kfree(ai); > } Applied! Thanks, //richard