summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinjie Ruan <ruanjinjie@huawei.com>2024-08-13 19:53:33 +0800
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2024-10-31 10:59:42 +0900
commitce7f27dcd7e7721527648e27908e5200d1a3e3b0 (patch)
treeb0aa2f8b46faa6b3d7529e01990a03f3ba2b5362
parent42f7652d3eb527d03665b09edac47f85fb600924 (diff)
downloadlwn-ce7f27dcd7e7721527648e27908e5200d1a3e3b0.tar.gz
lwn-ce7f27dcd7e7721527648e27908e5200d1a3e3b0.zip
kprobes: Cleanup the config comment
The CONFIG_KPROBES_ON_FTRACE #if/#else/#endif section is small and doesn't nest additional #ifdefs so the comment is useless and should be removed, but the __ARCH_WANT_KPROBES_INSN_SLOT and CONFIG_OPTPROBES() nest is long, it is better to add comment for reading. Link: https://lore.kernel.org/all/20240813115334.3922580-3-ruanjinjie@huawei.com/ Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
-rw-r--r--kernel/kprobes.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index da59c68df841..5f4117b1ff70 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -353,8 +353,8 @@ struct kprobe_insn_cache kprobe_optinsn_slots = {
/* .insn_size is initialized later */
.nr_garbage = 0,
};
-#endif
-#endif
+#endif /* CONFIG_OPTPROBES */
+#endif /* __ARCH_WANT_KPROBES_INSN_SLOT */
/* We have preemption disabled.. so it is safe to use __ versions */
static inline void set_kprobe_instance(struct kprobe *kp)
@@ -1543,7 +1543,7 @@ static int check_ftrace_location(struct kprobe *p)
if (ftrace_location(addr) == addr) {
#ifdef CONFIG_KPROBES_ON_FTRACE
p->flags |= KPROBE_FLAG_FTRACE;
-#else /* !CONFIG_KPROBES_ON_FTRACE */
+#else
return -EINVAL;
#endif
}