Skip to content

Commit 8a36826

Browse files
rpptglaubitz
authored andcommitted
sh: kprobes: Remove unused variables in kprobe_exceptions_notify()
kbuild reports the following warning: arch/sh/kernel/kprobes.c: In function 'kprobe_exceptions_notify': >> arch/sh/kernel/kprobes.c:412:24: warning: variable 'p' set but not used [-Wunused-but-set-variable] 412 | struct kprobe *p = NULL; | ^ The variable 'p' is indeed unused since the commit fa5a24b ("sh/kprobes: Don't call the ->break_handler() in SH kprobes code") Remove that variable along with 'kprobe_opcode_t *addr' which also becomes unused after 'p' is removed. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: fa5a24b ("sh/kprobes: Don't call the ->break_handler() in SH kprobes code") Signed-off-by: Mike Rapoport (Microsoft) <[email protected]> Reviewed-by: John Paul Adrian Glaubitz <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: John Paul Adrian Glaubitz <[email protected]>
1 parent ab0a168 commit 8a36826

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

arch/sh/kernel/kprobes.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,13 +404,10 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr)
404404
int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
405405
unsigned long val, void *data)
406406
{
407-
struct kprobe *p = NULL;
408407
struct die_args *args = (struct die_args *)data;
409408
int ret = NOTIFY_DONE;
410-
kprobe_opcode_t *addr = NULL;
411409
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
412410

413-
addr = (kprobe_opcode_t *) (args->regs->pc);
414411
if (val == DIE_TRAP &&
415412
args->trapnr == (BREAKPOINT_INSTRUCTION & 0xff)) {
416413
if (!kprobe_running()) {
@@ -421,7 +418,6 @@ int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
421418
ret = NOTIFY_DONE;
422419
}
423420
} else {
424-
p = get_kprobe(addr);
425421
if ((kcb->kprobe_status == KPROBE_HIT_SS) ||
426422
(kcb->kprobe_status == KPROBE_REENTER)) {
427423
if (post_kprobe_handler(args->regs))

0 commit comments

Comments
 (0)