With -Wmissing-prototypes enabled, there is a warning that unpoison_slab_object() has no prototype, breaking the build with CONFIG_WERROR=y: mm/kasan/common.c:271:6: error: no previous prototype for 'unpoison_slab_object' [-Werror=missing-prototypes] 271 | void unpoison_slab_object(struct kmem_cache *cache, void *object, gfp_t flags, | ^~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Mark the function as static, as it is not used outside of this translation unit, clearing up the warning. Fixes: 3f38c3c5bc40 ("kasan: save alloc stack traces for mempool") Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx> --- mm/kasan/common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/kasan/common.c b/mm/kasan/common.c index ebb1b23d6480..563cda95240b 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c @@ -277,8 +277,8 @@ void __kasan_kfree_large(void *ptr, unsigned long ip) /* The object will be poisoned by kasan_poison_pages(). */ } -void unpoison_slab_object(struct kmem_cache *cache, void *object, gfp_t flags, - bool init) +static void unpoison_slab_object(struct kmem_cache *cache, void *object, + gfp_t flags, bool init) { /* * Unpoison the whole object. For kmalloc() allocations, --- base-commit: eacce8189e28717da6f44ee492b7404c636ae0de change-id: 20231221-mark-unpoison_slab_object-as-static-3bf224e1527f Best regards, -- Nathan Chancellor <nathan@xxxxxxxxxx>