]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
LoongArch: Handle KCOV __init vs inline mismatches
authorKees Cook <kees@kernel.org>
Thu, 26 Jun 2025 12:07:18 +0000 (20:07 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Thu, 26 Jun 2025 12:07:18 +0000 (20:07 +0800)
When the KCOV is enabled all functions get instrumented, unless
the __no_sanitize_coverage attribute is used. To prepare for
__no_sanitize_coverage being applied to __init functions, we have to
handle differences in how GCC's inline optimizations get resolved.
For LoongArch this exposed several places where __init annotations
were missing but ended up being "accidentally correct". So fix these
cases.

Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/smp.h
arch/loongarch/kernel/time.c
arch/loongarch/mm/ioremap.c

index ad0bd234a0f1f2450ee7fd7ee402c54ebe08cff8..3a47f52959a88331cc2125198b050633ff8bd3cb 100644 (file)
@@ -39,7 +39,7 @@ int loongson_cpu_disable(void);
 void loongson_cpu_die(unsigned int cpu);
 #endif
 
-static inline void plat_smp_setup(void)
+static inline void __init plat_smp_setup(void)
 {
        loongson_smp_setup();
 }
index bc75a3a69fc8d55300dfe9d0dec7f8d0ca32f0b0..367906b10f810a11952cb8b3d7604fab31a872fb 100644 (file)
@@ -102,7 +102,7 @@ static int constant_timer_next_event(unsigned long delta, struct clock_event_dev
        return 0;
 }
 
-static unsigned long __init get_loops_per_jiffy(void)
+static unsigned long get_loops_per_jiffy(void)
 {
        unsigned long lpj = (unsigned long)const_clock_freq;
 
index 70ca7301981106b680bbc506b2ef340d01e73911..df949a3d0f34a70c6b5928cda9409c70638398f4 100644 (file)
@@ -16,12 +16,12 @@ void __init early_iounmap(void __iomem *addr, unsigned long size)
 
 }
 
-void *early_memremap_ro(resource_size_t phys_addr, unsigned long size)
+void * __init early_memremap_ro(resource_size_t phys_addr, unsigned long size)
 {
        return early_memremap(phys_addr, size);
 }
 
-void *early_memremap_prot(resource_size_t phys_addr, unsigned long size,
+void * __init early_memremap_prot(resource_size_t phys_addr, unsigned long size,
                    unsigned long prot_val)
 {
        return early_memremap(phys_addr, size);