Skip to contentSkip to conversation

x86/kprobes: remove extern from arch_unoptimized_kprobes

PATCH In review Tom Rix 2 participants 2 messages Mar 4, 2023 – Mar 6, 2023 x86

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 x86/kprobes: remove extern from arch_unoptimized_kprobes

smatch reports
arch/x86/kernel/kprobes/opt.c:537:13: warning:
function 'arch_unoptimize_kprobes' with external linkage has definition

extern is only needed in a declaration, so remove it.

---
 arch/x86/kernel/kprobes/opt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/kprobes/opt.c +2 -2
index 57b0037d0a99..1e699deb77fe 100644
@@ -534,8 +534,8 @@ void arch_unoptimize_kprobe(struct optimized_kprobe *op)
  * Recover original instructions and breakpoints from relative jumps.
  * Caller must call with locking kprobe_mutex.
  */
-extern void arch_unoptimize_kprobes(struct list_head *oplist,
-				    struct list_head *done_list)
+void arch_unoptimize_kprobes(struct list_head *oplist,
+			     struct list_head *done_list)
 {
 	struct optimized_kprobe *op, *tmp;
 
Signature · 1 line
2.27.0
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · On Sat, 4 Mar 2023 09:15:44 -0500 Tom Rix <[email protected]> wrote:

smatch reports
arch/x86/kernel/kprobes/opt.c:537:13: warning:
function 'arch_unoptimize_kprobes' with external linkage has definition

extern is only needed in a declaration, so remove it.

Thanks for pointing it out! This looks good to me.

Thanks,

Quoted 24 lines
---
 arch/x86/kernel/kprobes/opt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/kprobes/opt.c +2 -2
index 57b0037d0a99..1e699deb77fe 100644
@@ -534,8 +534,8 @@ void arch_unoptimize_kprobe(struct optimized_kprobe *op)
  * Recover original instructions and breakpoints from relative jumps.
  * Caller must call with locking kprobe_mutex.
  */
-extern void arch_unoptimize_kprobes(struct list_head *oplist,
-				    struct list_head *done_list)
+void arch_unoptimize_kprobes(struct list_head *oplist,
+			     struct list_head *done_list)
 {
 	struct optimized_kprobe *op, *tmp;
 
Signature · 1 line
2.27.0
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>