Skip to content

Commit 2424fe1

Browse files
committed
arm: Handle KCOV __init vs inline mismatches
When 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 arm this exposed several places where __init annotations were missing but ended up being "accidentally correct". Fix these cases and force several functions to be inline with __always_inline. Acked-by: Nishanth Menon <[email protected]> Acked-by: Lee Jones <[email protected]> Reviewed-by: Nishanth Menon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent d01daf9 commit 2424fe1

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

arch/arm/mm/cache-feroceon-l2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static inline u32 read_extra_features(void)
295295
return u;
296296
}
297297

298-
static inline void write_extra_features(u32 u)
298+
static inline void __init write_extra_features(u32 u)
299299
{
300300
__asm__("mcr p15, 1, %0, c15, c1, 0" : : "r" (u));
301301
}

arch/arm/mm/cache-tauros2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ static inline void __init write_actlr(u32 actlr)
177177
__asm__("mcr p15, 0, %0, c1, c0, 1\n" : : "r" (actlr));
178178
}
179179

180-
static void enable_extra_feature(unsigned int features)
180+
static void __init enable_extra_feature(unsigned int features)
181181
{
182182
u32 u;
183183

drivers/clocksource/timer-orion.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static struct delay_timer orion_delay_timer = {
4343
.read_current_timer = orion_read_timer,
4444
};
4545

46-
static void orion_delay_timer_init(unsigned long rate)
46+
static void __init orion_delay_timer_init(unsigned long rate)
4747
{
4848
orion_delay_timer.freq = rate;
4949
register_current_timer_delay(&orion_delay_timer);

drivers/soc/ti/pm33xx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ static int am33xx_do_sram_idle(u32 wfi_flags)
145145
return pm_ops->cpu_suspend(am33xx_do_wfi_sram, wfi_flags);
146146
}
147147

148-
static int __init am43xx_map_gic(void)
148+
static int am43xx_map_gic(void)
149149
{
150150
gic_dist_base = ioremap(AM43XX_GIC_DIST_BASE, SZ_4K);
151151

include/linux/mfd/dbx500-prcmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ struct prcmu_fw_version {
213213

214214
#if defined(CONFIG_UX500_SOC_DB8500)
215215

216-
static inline void prcmu_early_init(void)
216+
static inline void __init prcmu_early_init(void)
217217
{
218218
db8500_prcmu_early_init();
219219
}

0 commit comments

Comments
 (0)