tlbmiss_handler_setup_pgd is defined as a pointer to a u32 array in tlbex.c and as a function pointer in mmu_context.h. This was done because tlbex.c fills the memory of u32 with assembler code which implements a function, this assembler code depends on the CPU being used. Later the code will jump into this function. This patch uses the same type for both definitions and makes use of the pointer to the _start of the function in places where we have to access the code of the function. This fixes the build with LTO. Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx> --- arch/mips/mm/tlbex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index 79b9f2ad3ff5..f1aa5989a424 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c @@ -1575,7 +1575,7 @@ extern u32 handle_tlbl[], handle_tlbl_end[]; extern u32 handle_tlbs[], handle_tlbs_end[]; extern u32 handle_tlbm[], handle_tlbm_end[]; extern u32 tlbmiss_handler_setup_pgd_start[]; -extern u32 tlbmiss_handler_setup_pgd[]; +extern void tlbmiss_handler_setup_pgd(unsigned long); EXPORT_SYMBOL_GPL(tlbmiss_handler_setup_pgd); extern u32 tlbmiss_handler_setup_pgd_end[]; @@ -1592,7 +1592,7 @@ static void build_setup_pgd(void) #endif memset(tlbmiss_handler_setup_pgd, 0, tlbmiss_handler_setup_pgd_size * - sizeof(tlbmiss_handler_setup_pgd[0])); + sizeof(u32)); memset(labels, 0, sizeof(labels)); memset(relocs, 0, sizeof(relocs)); pgd_reg = allocate_kscratch(); @@ -1650,9 +1650,9 @@ static void build_setup_pgd(void) uasm_resolve_relocs(relocs, labels); pr_debug("Wrote tlbmiss_handler_setup_pgd (%u instructions).\n", - (unsigned int)(p - tlbmiss_handler_setup_pgd)); + (unsigned int)(p - tlbmiss_handler_setup_pgd_start)); - dump_handler("tlbmiss_handler", tlbmiss_handler_setup_pgd, + dump_handler("tlbmiss_handler", tlbmiss_handler_setup_pgd_start, tlbmiss_handler_setup_pgd_size); } -- 2.11.0