Skip to content

Commit

Permalink
arm64: move early_brk64 prototype to header
Browse files Browse the repository at this point in the history
The prototype used for calling early_brk64() is in the file that calls
it, which is the wrong place, as it is not included for the definition:

arch/arm64/kernel/traps.c:1100:12: error: no previous prototype for 'early_brk64' [-Werror=missing-prototypes]

Move it to an appropriate header instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20230516160642.523862-15-arnd@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Arnd Bergmann authored and Catalin Marinas committed May 25, 2023
1 parent 8ada7aa commit e13d32e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions arch/arm64/include/asm/traps.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ void arm64_force_sig_fault(int signo, int code, unsigned long far, const char *s
void arm64_force_sig_mceerr(int code, unsigned long far, short lsb, const char *str);
void arm64_force_sig_ptrace_errno_trap(int errno, unsigned long far, const char *str);

int early_brk64(unsigned long addr, unsigned long esr, struct pt_regs *regs);

/*
* Move regs->pc to next instruction and do necessary setup before it
* is executed.
Expand Down
3 changes: 0 additions & 3 deletions arch/arm64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,6 @@ void do_sp_pc_abort(unsigned long addr, unsigned long esr, struct pt_regs *regs)
}
NOKPROBE_SYMBOL(do_sp_pc_abort);

int __init early_brk64(unsigned long addr, unsigned long esr,
struct pt_regs *regs);

/*
* __refdata because early_brk64 is __init, but the reference to it is
* clobbered at arch_initcall time.
Expand Down

0 comments on commit e13d32e

Please sign in to comment.