mm: kmemleak: mark kmemleak_init prototype as __init
PATCH 1/1 mm: kmemleak: mark kmemleak_init prototype as __init
kmemleak_init() definition in mm/kmemleak.c is marked __init but its prototype in include/linux/kmemleak.h is marked __ref since commit a6186d89c913 ("kmemleak: Mark the early log buffer as __initdata").
This causes a section mismatch which is reported as a warning when building with clang -Wsection, because kmemleak_init() is declared in section .ref.text but defined in .init.text.
Fix this by marking kmemleak_init() prototype __init.
--- include/linux/kmemleak.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/kmemleak.h +1 -1
@@ -25,7 +25,7 @@#ifdef CONFIG_DEBUG_KMEMLEAK -extern void kmemleak_init (void )__ref ; +extern void kmemleak_init (void )__init ;extern void kmemleak_alloc (const void *ptr,size_t size,int min_count,gfp_t gfp)__ref ; extern void kmemleak_alloc_percpu(const void __percpu *ptr, size_t size,
Signature · 1 line
2.4.5
Quoted 20 lines · Nicolas Iooss
kmemleak_init()definition inmm/kmemleak.cis marked__initbut its prototype ininclude/linux/kmemleak.his marked__refsince commita6186d89c913("kmemleak: Mark the early log buffer as__initdata").This causes a section mismatch which is reported as a warning when building with clang -Wsection, because
kmemleak_init()is declared in section .ref.text but defined in .init.text.Fix this by marking
kmemleak_init()prototype__init.Signed-off-by Nicolas Iooss <[email protected]>--- include/linux/kmemleak.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/kmemleak.h +0
-0
include/linux/kmemleak.h line 31
Quoted 8 lines
include/linux/kmemleak.h +1
-1@@ -25,7 +25,7 @@#ifdef CONFIG_DEBUG_KMEMLEAK -extern void kmemleak_init (void )__ref ; +extern void kmemleak_init (void )__init ;extern void kmemleak_alloc (const void *ptr,size_t size,int min_count,gfp_t gfp)__ref ; extern void kmemleak_alloc_percpu(const void __percpu *ptr, size_t size,
I forgot about this patch. Andrew, could you please queue this patch for 4.4? Thanks.
Signature · 1 line
Catalin