Messages in this thread Patch in this message | | | From | thunder.leizhen@huaweicl ... | Subject | [PATCH v3 1/2] mm: Provide empty function for kmem_dump_obj() when CONFIG_PRINTK=n | Date | Wed, 2 Aug 2023 11:45:16 +0800 |
| |
From: Zhen Lei <thunder.leizhen@huawei.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@huawei.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
| |