[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55F6D86B.3000304@bfs.de>
Date: Mon, 14 Sep 2015 16:23:39 +0200
From: walter harms <wharms@....de>
To: Mikulas Patocka <mpatocka@...hat.com>
CC: device-mapper development <dm-devel@...hat.com>,
Alasdair Kergon <agk@...hat.com>,
Mike Snitzer <snitzer@...hat.com>,
kernel-janitors@...r.kernel.org, Neil Brown <neilb@...e.com>,
linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org,
sergey.senozhatsky@...il.com
Subject: Re: [dm-devel] [PATCH 12/39] dm: drop null test before destroy functions
Am 14.09.2015 15:46, schrieb Mikulas Patocka:
>
> On Sun, 13 Sep 2015, 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@...6.fr>
>> >
>> > ---
>> > drivers/md/dm-bufio.c | 3 +--
>> > drivers/md/dm-cache-target.c | 3 +--
>> > drivers/md/dm-crypt.c | 6 ++----
>> > drivers/md/dm-io.c | 3 +--
>> > drivers/md/dm-log-userspace-base.c | 3 +--
>> > drivers/md/dm-region-hash.c | 4 +---
>> > drivers/md/dm.c | 13 ++++---------
>> > 7 files changed, 11 insertions(+), 24 deletions(-)
>> >
>> > diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
>> > index 83cc52e..8ad39b6 100644
>> > --- a/drivers/md/dm-bufio.c
>> > +++ b/drivers/md/dm-bufio.c
>> > @@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
>> > for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
>> > struct kmem_cache *kc = dm_bufio_caches[i];
>> >
>> > - if (kc)
>> > - kmem_cache_destroy(kc);
>> > + kmem_cache_destroy(kc);
>> > }
maybe you want to remove "kc" also
by calling kmem_cache_destroy(dm_bufio_caches[i]); directly ?
just a hint,
wh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists