From 9a435b7bc911d971490f0ce37aa0c6a1308722f4 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Fri, 18 Nov 2022 15:22:51 +0100 Subject: [PATCH] s390/kprobes: define insn cache ops within private header file clang warns about an unused insn cache ops function: arch/s390/kernel/kprobes.c:34:1: error: unused function 'is_kprobe_s390_insn_slot' [-Werror,-Wunused-function] DEFINE_INSN_CACHE_OPS(s390_insn); ^ ./include/linux/kprobes.h:335:20: note: expanded from macro 'DEFINE_INSN_CACHE_OPS' static inline bool is_kprobe_##__name##_slot(unsigned long addr) \ ^ :88:1: note: expanded from here is_kprobe_s390_insn_slot ^ Move the definition to a private header file, which is also similar to the generic insn cache ops. Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev --- arch/s390/kernel/kprobes.c | 3 +-- arch/s390/kernel/kprobes.h | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 arch/s390/kernel/kprobes.h diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index 0032bdbe8e3f..401f9c933ff9 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c @@ -24,6 +24,7 @@ #include #include #include +#include "kprobes.h" #include "entry.h" DEFINE_PER_CPU(struct kprobe *, current_kprobe); @@ -31,8 +32,6 @@ DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); struct kretprobe_blackpoint kretprobe_blacklist[] = { }; -DEFINE_INSN_CACHE_OPS(s390_insn); - static int insn_page_in_use; void *alloc_insn_page(void) diff --git a/arch/s390/kernel/kprobes.h b/arch/s390/kernel/kprobes.h new file mode 100644 index 000000000000..dc3ed5098ee7 --- /dev/null +++ b/arch/s390/kernel/kprobes.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +#ifndef _ARCH_S390_KPROBES_H +#define _ARCH_S390_KPROBES_H + +#include + +DEFINE_INSN_CACHE_OPS(s390_insn); + +#endif