]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kprobes: unify kprobes_exceptions_nofify() prototypes
authorArnd Bergmann <arnd@arndb.de>
Fri, 10 Nov 2023 10:59:05 +0000 (19:59 +0900)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Fri, 10 Nov 2023 10:59:05 +0000 (19:59 +0900)
Most architectures that support kprobes declare this function in their
own asm/kprobes.h header and provide an override, but some are missing
the prototype, which causes a warning for the __weak stub implementation:

kernel/kprobes.c:1865:12: error: no previous prototype for 'kprobe_exceptions_notify' [-Werror=missing-prototypes]
 1865 | int __weak kprobe_exceptions_notify(struct notifier_block *self,

Move the prototype into linux/kprobes.h so it is visible to all
the definitions.

Link: https://lore.kernel.org/all/20231108125843.3806765-4-arnd@kernel.org/
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
arch/arc/include/asm/kprobes.h
arch/arm/include/asm/kprobes.h
arch/arm64/include/asm/kprobes.h
arch/mips/include/asm/kprobes.h
arch/powerpc/include/asm/kprobes.h
arch/s390/include/asm/kprobes.h
arch/sh/include/asm/kprobes.h
arch/sparc/include/asm/kprobes.h
arch/x86/include/asm/kprobes.h
include/linux/kprobes.h

index de1566e32cb89d885841687dec53b0bf9dfff582..68e8301c0df2c1e44bb15034f1eaa9d896884d3e 100644 (file)
@@ -32,9 +32,6 @@ struct kprobe;
 
 void arch_remove_kprobe(struct kprobe *p);
 
-int kprobe_exceptions_notify(struct notifier_block *self,
-                            unsigned long val, void *data);
-
 struct prev_kprobe {
        struct kprobe *kp;
        unsigned long status;
index e26a278d301ab0e05a73158bbd8fb5263f2f84d6..5b8dbf1b0be49e483ecf8e1880c657cdcc3dc1a9 100644 (file)
@@ -40,8 +40,6 @@ struct kprobe_ctlblk {
 
 void arch_remove_kprobe(struct kprobe *);
 int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
-int kprobe_exceptions_notify(struct notifier_block *self,
-                            unsigned long val, void *data);
 
 /* optinsn template addresses */
 extern __visible kprobe_opcode_t optprobe_template_entry[];
index 05cd82eeca1365b5f5be1f7b6ac107982a9afa14..be7a3680dadff7cc2859c3dcfdd703ce50e093e9 100644 (file)
@@ -37,8 +37,6 @@ struct kprobe_ctlblk {
 
 void arch_remove_kprobe(struct kprobe *);
 int kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr);
-int kprobe_exceptions_notify(struct notifier_block *self,
-                            unsigned long val, void *data);
 void __kretprobe_trampoline(void);
 void __kprobes *trampoline_probe_handler(struct pt_regs *regs);
 
index 68b1e5d458cfb6a28278289c37ca78e94e61230d..bc27d99c94363418b03ad0d2b48814e6472fdd4a 100644 (file)
@@ -71,8 +71,6 @@ struct kprobe_ctlblk {
        struct prev_kprobe prev_kprobe;
 };
 
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-                                   unsigned long val, void *data);
 
 #endif /* CONFIG_KPROBES */
 #endif /* _ASM_KPROBES_H */
index c8e4b4fd4e33020261861c76d0139b7abab792d5..4525a9c68260d9017dcc303e27c8e0d70dc6e5d9 100644 (file)
@@ -84,8 +84,6 @@ struct arch_optimized_insn {
        kprobe_opcode_t *insn;
 };
 
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-                                       unsigned long val, void *data);
 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
 extern int kprobe_handler(struct pt_regs *regs);
 extern int kprobe_post_handler(struct pt_regs *regs);
index 21b9e5290c0488d3ba9ed1db83a81c4e906f17af..01f1682a73b7614388ff6d71c35d83c998d7932c 100644 (file)
@@ -73,8 +73,6 @@ struct kprobe_ctlblk {
 void arch_remove_kprobe(struct kprobe *p);
 
 int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
-int kprobe_exceptions_notify(struct notifier_block *self,
-       unsigned long val, void *data);
 
 #define flush_insn_slot(p)     do { } while (0)
 
index eeba83e0a7d29408dfeb5b56272f0b10a26a242a..65d4c3316a5bd29ccc93742947f48c4687021510 100644 (file)
@@ -46,8 +46,6 @@ struct kprobe_ctlblk {
 };
 
 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-                                   unsigned long val, void *data);
 extern int kprobe_handle_illslot(unsigned long pc);
 #else
 
index 06c2bc767ef75112fbae2ca477dc319df44ccef8..aec742cd898f272cc5f960a392780b59e3054b7e 100644 (file)
@@ -47,8 +47,6 @@ struct kprobe_ctlblk {
        struct prev_kprobe prev_kprobe;
 };
 
-int kprobe_exceptions_notify(struct notifier_block *self,
-                            unsigned long val, void *data);
 int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
 asmlinkage void __kprobes kprobe_trap(unsigned long trap_level,
                                      struct pt_regs *regs);
index a2e9317aad4955c1110e9f19d5b94ffd837b3865..5939694dfb28dc10733af721f3fc2a71dd3e7057 100644 (file)
@@ -113,8 +113,6 @@ struct kprobe_ctlblk {
 };
 
 extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr);
-extern int kprobe_exceptions_notify(struct notifier_block *self,
-                                   unsigned long val, void *data);
 extern int kprobe_int3_handler(struct pt_regs *regs);
 
 #else
index 365eb092e9c4e9ff7b74cdc051078e7cec0aaca4..ab1da3142b06a94e71f977d5d7715f2245e0f3ae 100644 (file)
@@ -445,6 +445,10 @@ int kprobe_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
 
 int arch_kprobe_get_kallsym(unsigned int *symnum, unsigned long *value,
                            char *type, char *sym);
+
+int kprobe_exceptions_notify(struct notifier_block *self,
+                            unsigned long val, void *data);
+
 #else /* !CONFIG_KPROBES: */
 
 static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr)