[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230802034518.1115-2-thunder.leizhen@huaweicloud.com>
Date: Wed, 2 Aug 2023 11:45:16 +0800
From: thunder.leizhen@...weicloud.com
To: Christoph Lameter <cl@...ux.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
Roman Gushchin <roman.gushchin@...ux.dev>,
Hyeonggon Yoo <42.hyeyoo@...il.com>, linux-mm@...ck.org,
"Paul E . McKenney" <paulmck@...nel.org>,
Frederic Weisbecker <frederic@...nel.org>,
Neeraj Upadhyay <quic_neeraju@...cinc.com>,
Joel Fernandes <joel@...lfernandes.org>,
Josh Triplett <josh@...htriplett.org>,
Boqun Feng <boqun.feng@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>,
Zqiang <qiang.zhang1211@...il.com>, rcu@...r.kernel.org,
linux-kernel@...r.kernel.org, openeuler <kernel@...neuler.org>
Subject: [PATCH v3 1/2] mm: Provide empty function for kmem_dump_obj() when CONFIG_PRINTK=n
From: Zhen Lei <thunder.leizhen@...wei.com>
Commit 5bb1bb353cfe ("mm: Don't build mm_dump_obj() on CONFIG_PRINTK=n
kernels") only provides static inline empty function for mem_dump_obj().
But functions kmem_valid_obj() and kmem_dump_obj() are also exported,
they may be called by functions other than mem_dump_obj(), so their empty
functions should also be provided when CONFIG_PRINTK=n.
Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
---
include/linux/slab.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 848c7c82ad5ad0b..fc05fe288d176b4 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -246,6 +246,9 @@ size_t ksize(const void *objp);
#ifdef CONFIG_PRINTK
bool kmem_valid_obj(void *object);
void kmem_dump_obj(void *object);
+#else
+static inline bool kmem_valid_obj(void *object) { return false; }
+static inline void kmem_dump_obj(void *object) {}
#endif
/*
--
2.34.1
Powered by blists - more mailing lists