Skip to content

Commit a0137c9

Browse files
keeschenhuacai
authored andcommitted
LoongArch: Handle KCOV __init vs inline mismatches
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 <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent 39503fc commit a0137c9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

arch/loongarch/include/asm/smp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int loongson_cpu_disable(void);
3939
void loongson_cpu_die(unsigned int cpu);
4040
#endif
4141

42-
static inline void plat_smp_setup(void)
42+
static inline void __init plat_smp_setup(void)
4343
{
4444
loongson_smp_setup();
4545
}

arch/loongarch/kernel/time.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static int constant_timer_next_event(unsigned long delta, struct clock_event_dev
102102
return 0;
103103
}
104104

105-
static unsigned long __init get_loops_per_jiffy(void)
105+
static unsigned long get_loops_per_jiffy(void)
106106
{
107107
unsigned long lpj = (unsigned long)const_clock_freq;
108108

arch/loongarch/mm/ioremap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ void __init early_iounmap(void __iomem *addr, unsigned long size)
1616

1717
}
1818

19-
void *early_memremap_ro(resource_size_t phys_addr, unsigned long size)
19+
void * __init early_memremap_ro(resource_size_t phys_addr, unsigned long size)
2020
{
2121
return early_memremap(phys_addr, size);
2222
}
2323

24-
void *early_memremap_prot(resource_size_t phys_addr, unsigned long size,
24+
void * __init early_memremap_prot(resource_size_t phys_addr, unsigned long size,
2525
unsigned long prot_val)
2626
{
2727
return early_memremap(phys_addr, size);

0 commit comments

Comments
 (0)