Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/rethook: add local rethook header file

Compiling the kernel with CONFIG_KPROBES disabled, but CONFIG_RETHOOK
enabled, results in this sparse warning:

arch/s390/kernel/rethook.c:26:15: warning: no previous prototype for 'arch_rethook_trampoline_callback' [-Wmissing-prototypes]
26 | unsigned long arch_rethook_trampoline_callback(struct pt_regs *regs)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add a local rethook header file similar to riscv to address this.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 1a280f48c0e4 ("s390/kprobes: replace kretprobe with rethook")
Link: https://lore.kernel.org/all/202302030102.69dZIuJk-lkp@intel.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

+8 -1
-1
arch/s390/include/asm/kprobes.h
··· 70 70 }; 71 71 72 72 void arch_remove_kprobe(struct kprobe *p); 73 - unsigned long arch_rethook_trampoline_callback(struct pt_regs *regs); 74 73 75 74 int kprobe_fault_handler(struct pt_regs *regs, int trapnr); 76 75 int kprobe_exceptions_notify(struct notifier_block *self,
+1
arch/s390/kernel/rethook.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-or-later 2 2 #include <linux/rethook.h> 3 3 #include <linux/kprobes.h> 4 + #include "rethook.h" 4 5 5 6 void arch_rethook_prepare(struct rethook_node *rh, struct pt_regs *regs, bool mcount) 6 7 {
+7
arch/s390/kernel/rethook.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #ifndef __S390_RETHOOK_H 3 + #define __S390_RETHOOK_H 4 + 5 + unsigned long arch_rethook_trampoline_callback(struct pt_regs *regs); 6 + 7 + #endif