Skip to content

Commit 5303df2

Browse files
zongboxpalmer-dabbelt
authored andcommitted
riscv: Use NOKPROBE_SYMBOL() instead of __krpobes annotation
The __kprobes annotation is old style, so change it to NOKPROBE_SYMBOL(). Signed-off-by: Zong Li <[email protected]> Reviewed-by: Masami Hiramatsu <[email protected]> Reviewed-by: Palmer Dabbelt <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent b80b3d5 commit 5303df2

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

arch/riscv/kernel/patch.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct patch_insn {
2020
#ifdef CONFIG_MMU
2121
static DEFINE_RAW_SPINLOCK(patch_lock);
2222

23-
static void __kprobes *patch_map(void *addr, int fixmap)
23+
static void *patch_map(void *addr, int fixmap)
2424
{
2525
uintptr_t uintaddr = (uintptr_t) addr;
2626
struct page *page;
@@ -37,13 +37,15 @@ static void __kprobes *patch_map(void *addr, int fixmap)
3737
return (void *)set_fixmap_offset(fixmap, page_to_phys(page) +
3838
(uintaddr & ~PAGE_MASK));
3939
}
40+
NOKPROBE_SYMBOL(patch_map);
4041

41-
static void __kprobes patch_unmap(int fixmap)
42+
static void patch_unmap(int fixmap)
4243
{
4344
clear_fixmap(fixmap);
4445
}
46+
NOKPROBE_SYMBOL(patch_unmap);
4547

46-
static int __kprobes patch_insn_write(void *addr, const void *insn, size_t len)
48+
static int patch_insn_write(void *addr, const void *insn, size_t len)
4749
{
4850
void *waddr = addr;
4951
bool across_pages = (((uintptr_t) addr & ~PAGE_MASK) + len) > PAGE_SIZE;
@@ -68,14 +70,16 @@ static int __kprobes patch_insn_write(void *addr, const void *insn, size_t len)
6870

6971
return ret;
7072
}
73+
NOKPROBE_SYMBOL(patch_insn_write);
7174
#else
72-
static int __kprobes patch_insn_write(void *addr, const void *insn, size_t len)
75+
static int patch_insn_write(void *addr, const void *insn, size_t len)
7376
{
7477
return probe_kernel_write(addr, insn, len);
7578
}
79+
NOKPROBE_SYMBOL(patch_insn_write);
7680
#endif /* CONFIG_MMU */
7781

78-
int __kprobes patch_text_nosync(void *addr, const void *insns, size_t len)
82+
int patch_text_nosync(void *addr, const void *insns, size_t len)
7983
{
8084
u32 *tp = addr;
8185
int ret;
@@ -87,8 +91,9 @@ int __kprobes patch_text_nosync(void *addr, const void *insns, size_t len)
8791

8892
return ret;
8993
}
94+
NOKPROBE_SYMBOL(patch_text_nosync);
9095

91-
static int __kprobes patch_text_cb(void *data)
96+
static int patch_text_cb(void *data)
9297
{
9398
struct patch_insn *patch = data;
9499
int ret = 0;
@@ -106,8 +111,9 @@ static int __kprobes patch_text_cb(void *data)
106111

107112
return ret;
108113
}
114+
NOKPROBE_SYMBOL(patch_text_cb);
109115

110-
int __kprobes patch_text(void *addr, u32 insn)
116+
int patch_text(void *addr, u32 insn)
111117
{
112118
struct patch_insn patch = {
113119
.addr = addr,
@@ -118,3 +124,4 @@ int __kprobes patch_text(void *addr, u32 insn)
118124
return stop_machine_cpuslocked(patch_text_cb,
119125
&patch, cpu_online_mask);
120126
}
127+
NOKPROBE_SYMBOL(patch_text);

0 commit comments

Comments
 (0)