summaryrefslogtreecommitdiff
path: root/mm/util.c
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2023-08-05 11:17:25 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-08-29 17:30:28 +0200
commita34268fefb0248c2550f166f78a5acb327cba8fb (patch)
tree912eaa73d99a401827c87f9c40582da51dfce9a9 /mm/util.c
parent62b6ce5d8714c4fa1679bf352ef722be78b141ae (diff)
downloadlinux-a34268fefb0248c2550f166f78a5acb327cba8fb.tar.gz
linux-a34268fefb0248c2550f166f78a5acb327cba8fb.tar.bz2
linux-a34268fefb0248c2550f166f78a5acb327cba8fb.zip
mm: Remove kmem_valid_obj()
commit 6e284c55fc0bef7d25fd34d29db11f483da60ea4 upstream. Function kmem_dump_obj() will splat if passed a pointer to a non-slab object. So nothing calls it directly, instead calling kmem_valid_obj() first to determine whether the passed pointer to a valid slab object. This means that merging kmem_valid_obj() into kmem_dump_obj() will make the code more concise. Therefore, convert kmem_dump_obj() to work the same way as vmalloc_dump_obj(), removing the need for the kmem_dump_obj() caller to check kmem_valid_obj(). After this, there are no remaining calls to kmem_valid_obj() anymore, and it can be safely removed. Suggested-by: Matthew Wilcox <willy@infradead.org> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/util.c')
-rw-r--r--mm/util.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/mm/util.c b/mm/util.c
index ce3bb17c97b9..aa4f8a45dd56 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -1119,10 +1119,8 @@ void mem_dump_obj(void *object)
{
const char *type;
- if (kmem_valid_obj(object)) {
- kmem_dump_obj(object);
+ if (kmem_dump_obj(object))
return;
- }
if (vmalloc_dump_obj(object))
return;