From: Pekka Enberg <penberg@kernel.org>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, Pekka Enberg <penberg@kernel.org>,
Kent Overstreet <kmo@daterainc.com>
Subject: [PATCH 13/14] bcache: Use kvfree() in various places
Date: Fri, 15 May 2015 21:35:22 +0300 [thread overview]
Message-ID: <1431714923-23028-13-git-send-email-penberg@kernel.org> (raw)
In-Reply-To: <1431714923-23028-1-git-send-email-penberg@kernel.org>
Use kvfree() instead of open-coding it.
Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
---
drivers/md/bcache/super.c | 10 ++--------
drivers/md/bcache/util.h | 10 ++--------
2 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 4dd2bb7..94980bf 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -760,14 +760,8 @@ static void bcache_device_free(struct bcache_device *d)
bio_split_pool_free(&d->bio_split_hook);
if (d->bio_split)
bioset_free(d->bio_split);
- if (is_vmalloc_addr(d->full_dirty_stripes))
- vfree(d->full_dirty_stripes);
- else
- kfree(d->full_dirty_stripes);
- if (is_vmalloc_addr(d->stripe_sectors_dirty))
- vfree(d->stripe_sectors_dirty);
- else
- kfree(d->stripe_sectors_dirty);
+ kvfree(d->full_dirty_stripes);
+ kvfree(d->stripe_sectors_dirty);
closure_debug_destroy(&d->cl);
}
diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
index 98df757..1d04c48 100644
--- a/drivers/md/bcache/util.h
+++ b/drivers/md/bcache/util.h
@@ -52,10 +52,7 @@ struct closure;
#define free_heap(heap) \
do { \
- if (is_vmalloc_addr((heap)->data)) \
- vfree((heap)->data); \
- else \
- kfree((heap)->data); \
+ kvfree((heap)->data); \
(heap)->data = NULL; \
} while (0)
@@ -163,10 +160,7 @@ do { \
#define free_fifo(fifo) \
do { \
- if (is_vmalloc_addr((fifo)->data)) \
- vfree((fifo)->data); \
- else \
- kfree((fifo)->data); \
+ kvfree((fifo)->data); \
(fifo)->data = NULL; \
} while (0)
--
2.1.0
next prev parent reply other threads:[~2015-05-15 18:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 18:35 [PATCH 01/14] ipc/util.c: Use kvfree() in ipc_rcu_free() Pekka Enberg
2015-05-15 18:35 ` [PATCH 02/14] kernel/relay.c: Use kvfree() in relay_free_page_array() Pekka Enberg
2015-05-15 18:35 ` [PATCH 03/14] cxgb3: Use kvfree() in cxgb_free_mem() Pekka Enberg
2015-05-15 18:35 ` [PATCH 04/14] cxgb4: Use kvfree() in t4_free_mem() Pekka Enberg
2015-05-15 18:35 ` [PATCH 05/14] ceph: Use kvfree() in ceph_put_page_vector() Pekka Enberg
2015-05-18 5:45 ` Yan, Zheng
2015-05-18 6:58 ` Yan, Zheng
2015-05-18 6:59 ` Yan, Zheng
2015-05-15 18:35 ` [PATCH 06/14] drm: Use kvfree() in drm_free_large() Pekka Enberg
2015-05-15 18:35 ` [PATCH 07/14] drm/nouveau/gem: Use kvfree() in u_free() Pekka Enberg
2015-05-15 18:35 ` [PATCH 08/14] drivers/input/evdev.c: Use kvfree() in evdev_release() Pekka Enberg
2015-05-15 20:46 ` Dmitry Torokhov
2015-05-15 18:35 ` [PATCH 09/14] IB/ehca: Use kvfree() in ipz_queue_{cd}tor() Pekka Enberg
2015-05-15 18:35 ` [PATCH 10/14] target: Use kvfree() in session alloc and free Pekka Enberg
2015-05-15 18:35 ` [PATCH 11/14] libcxgbi: Use kvfree() in cxgbi_free_big_mem() Pekka Enberg
2015-05-15 18:35 ` [PATCH 12/14] dm: Use kvfree() in dm_kvfree() Pekka Enberg
2015-05-15 19:19 ` Mike Snitzer
2015-05-15 18:35 ` Pekka Enberg [this message]
2015-05-15 18:35 ` [PATCH 14/14] NTFS: Use kvfree() in ntfs_free() Pekka Enberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1431714923-23028-13-git-send-email-penberg@kernel.org \
--to=penberg@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=kmo@daterainc.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome