s390/kprobes: define insn cache ops within private header file
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 18 Nov 2022 14:22:51 +0000 (15:22 +0100)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Wed, 23 Nov 2022 15:24:07 +0000 (16:24 +0100)
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)        \
                   ^
<scratch space>: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 <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/kernel/kprobes.c
arch/s390/kernel/kprobes.h [new file with mode: 0644]

index 0032bdb..401f9c9 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/set_memory.h>
 #include <asm/sections.h>
 #include <asm/dis.h>
+#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 (file)
index 0000000..dc3ed50
--- /dev/null
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+#ifndef _ARCH_S390_KPROBES_H
+#define _ARCH_S390_KPROBES_H
+
+#include <linux/kprobes.h>
+
+DEFINE_INSN_CACHE_OPS(s390_insn);
+
+#endif