Skip to content

Commit 78cdaf3

Browse files
committed
arm64: Add kasan_hw_tags_enable() prototype to silence sparse
This function is only called from assembly, no need for a prototype declaration in a header file. In addition, add #ifdef around the function since it is only used when CONFIG_KASAN_HW_TAGS. Signed-off-by: Catalin Marinas <[email protected]> Reported-by: kernel test robot <[email protected]>
1 parent 2e990e6 commit 78cdaf3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/arm64/kernel/mte.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,11 @@ static void mte_update_gcr_excl(struct task_struct *task)
244244
SYS_GCR_EL1);
245245
}
246246

247+
#ifdef CONFIG_KASAN_HW_TAGS
248+
/* Only called from assembly, silence sparse */
249+
void __init kasan_hw_tags_enable(struct alt_instr *alt, __le32 *origptr,
250+
__le32 *updptr, int nr_inst);
251+
247252
void __init kasan_hw_tags_enable(struct alt_instr *alt, __le32 *origptr,
248253
__le32 *updptr, int nr_inst)
249254
{
@@ -252,6 +257,7 @@ void __init kasan_hw_tags_enable(struct alt_instr *alt, __le32 *origptr,
252257
if (kasan_hw_tags_enabled())
253258
*updptr = cpu_to_le32(aarch64_insn_gen_nop());
254259
}
260+
#endif
255261

256262
void mte_thread_init_user(void)
257263
{

0 commit comments

Comments
 (0)