Skip to content

Commit 4402dea

Browse files
punitagrawalrostedt
authored andcommitted
kprobes: Make arch_check_ftrace_location static
arch_check_ftrace_location() was introduced as a weak function in commit f7f242f ("kprobes: introduce weak arch_check_ftrace_location() helper function") to allow architectures to handle kprobes call site on their own. Recently, the only architecture (csky) to implement arch_check_ftrace_location() was migrated to using the common version. As a result, further cleanup the code to drop the weak attribute and rename the function to remove the architecture specific implementation. Link: https://lkml.kernel.org/r/163163035673.489837.2367816318195254104.stgit@devnote2 Signed-off-by: Punit Agrawal <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 71bdc8f commit 4402dea

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

include/linux/kprobes.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,6 @@ static inline int arch_prepare_kprobe_ftrace(struct kprobe *p)
361361
}
362362
#endif
363363

364-
int arch_check_ftrace_location(struct kprobe *p);
365-
366364
/* Get the kprobe at this addr (if any) - called with preemption disabled */
367365
struct kprobe *get_kprobe(void *addr);
368366

kernel/kprobes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,7 +1524,7 @@ static inline int warn_kprobe_rereg(struct kprobe *p)
15241524
return ret;
15251525
}
15261526

1527-
int __weak arch_check_ftrace_location(struct kprobe *p)
1527+
static int check_ftrace_location(struct kprobe *p)
15281528
{
15291529
unsigned long ftrace_addr;
15301530

@@ -1547,7 +1547,7 @@ static int check_kprobe_address_safe(struct kprobe *p,
15471547
{
15481548
int ret;
15491549

1550-
ret = arch_check_ftrace_location(p);
1550+
ret = check_ftrace_location(p);
15511551
if (ret)
15521552
return ret;
15531553
jump_label_lock();

0 commit comments

Comments
 (0)