Skip to content

Commit 1422ae0

Browse files
geertuglaubitz
authored andcommitted
sh: kprobes: Merge arch_copy_kprobe() into arch_prepare_kprobe()
arch/sh/kernel/kprobes.c:52:16: warning: no previous prototype for 'arch_copy_kprobe' [-Wmissing-prototypes] Although SH kprobes support was only merged in v2.6.28, it missed the earlier removal of the arch_copy_kprobe() callback in v2.6.15. Based on the powerpc part of commit 49a2a1b ("[PATCH] kprobes: changed from using spinlock to mutex"). Fixes: d39f545 ("sh: Add kprobes support.") Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: John Paul Adrian Glaubitz <[email protected]> Link: https://lore.kernel.org/r/717d47a19689cc944fae6e981a1ad7cae1642c89.1709326528.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
1 parent f577cd2 commit 1422ae0

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

arch/sh/kernel/kprobes.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,12 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
4444
if (OPCODE_RTE(opcode))
4545
return -EFAULT; /* Bad breakpoint */
4646

47+
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
4748
p->opcode = opcode;
4849

4950
return 0;
5051
}
5152

52-
void __kprobes arch_copy_kprobe(struct kprobe *p)
53-
{
54-
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
55-
p->opcode = *p->addr;
56-
}
57-
5853
void __kprobes arch_arm_kprobe(struct kprobe *p)
5954
{
6055
*p->addr = BREAKPOINT_INSTRUCTION;

0 commit comments

Comments
 (0)