Skip to content

Commit cb1a55e

Browse files
geertuglaubitz
authored andcommitted
sh: kprobes: Remove unneeded kprobe_opcode_t casts
There is no need to cast a kprobe_opcode_t pointer to a kprobe_opcode_t pointer. Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: John Paul Adrian Glaubitz <[email protected]> Link: https://lore.kernel.org/r/fc22b990d869fc2005990159d8072ae2774b1396.1709326528.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
1 parent f96299b commit cb1a55e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/sh/kernel/kprobes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static DEFINE_PER_CPU(struct kprobe, saved_next_opcode2);
3939

4040
int __kprobes arch_prepare_kprobe(struct kprobe *p)
4141
{
42-
kprobe_opcode_t opcode = *(kprobe_opcode_t *) (p->addr);
42+
kprobe_opcode_t opcode = *p->addr;
4343

4444
if (OPCODE_RTE(opcode))
4545
return -EFAULT; /* Bad breakpoint */
@@ -248,7 +248,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
248248
p = get_kprobe(addr);
249249
if (!p) {
250250
/* Not one of ours: let kernel handle it */
251-
if (*(kprobe_opcode_t *)addr != BREAKPOINT_INSTRUCTION) {
251+
if (*addr != BREAKPOINT_INSTRUCTION) {
252252
/*
253253
* The breakpoint instruction was removed right
254254
* after we hit it. Another cpu has removed

0 commit comments

Comments
 (0)