Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hw-breakpoints: Fix build warnings with clang

kbuild test robot reported some build warnings in the hw_breakpoint
code when compiled with clang[1]. Some of them were introduced by the
recent powerpc change to add arch_reserve_bp_slot() and
arch_release_bp_slot(). Fix them all.

kernel/events/hw_breakpoint.c:71:12: warning: no previous prototype for function 'hw_breakpoint_weight'
kernel/events/hw_breakpoint.c:216:12: warning: no previous prototype for function 'arch_reserve_bp_slot'
kernel/events/hw_breakpoint.c:221:13: warning: no previous prototype for function 'arch_release_bp_slot'
kernel/events/hw_breakpoint.c:228:13: warning: no previous prototype for function 'arch_unregister_hw_breakpoint'

[1]: https://lore.kernel.org/linuxppc-dev/202005192233.oi9CjRtA%25lkp@intel.com/

Fixes: 29da4f91c0c1 ("powerpc/watchpoint: Don't allow concurrent perf and ptrace events")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
[mpe: Drop extern, flesh out change log, add Fixes tag]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200602041208.128913-1-ravi.bangoria@linux.ibm.com

authored by

Ravi Bangoria and committed by
Michael Ellerman
ef3534a9 09423522

+4 -3
-3
arch/powerpc/include/asm/hw_breakpoint.h
··· 70 70 unsigned long val, void *data); 71 71 int arch_install_hw_breakpoint(struct perf_event *bp); 72 72 void arch_uninstall_hw_breakpoint(struct perf_event *bp); 73 - int arch_reserve_bp_slot(struct perf_event *bp); 74 - void arch_release_bp_slot(struct perf_event *bp); 75 - void arch_unregister_hw_breakpoint(struct perf_event *bp); 76 73 void hw_breakpoint_pmu_read(struct perf_event *bp); 77 74 extern void flush_ptrace_hw_breakpoint(struct task_struct *tsk); 78 75
+4
include/linux/hw_breakpoint.h
··· 80 80 extern int dbg_release_bp_slot(struct perf_event *bp); 81 81 extern int reserve_bp_slot(struct perf_event *bp); 82 82 extern void release_bp_slot(struct perf_event *bp); 83 + int hw_breakpoint_weight(struct perf_event *bp); 84 + int arch_reserve_bp_slot(struct perf_event *bp); 85 + void arch_release_bp_slot(struct perf_event *bp); 86 + void arch_unregister_hw_breakpoint(struct perf_event *bp); 83 87 84 88 extern void flush_ptrace_hw_breakpoint(struct task_struct *tsk); 85 89