path: root/arch/hexagon/kernel
diff options
authorEric W. Biederman <ebiederm@xmission.com>2018-04-16 11:26:58 -0500
committerEric W. Biederman <ebiederm@xmission.com>2018-04-25 10:41:00 -0500
commit1a4bd9792dfac587dbec800e2c3e6d17a0b3e6d7 (patch)
treee1cd5134fcb903de343015b5c1d77908715e1969 /arch/hexagon/kernel
parentsignal/c6x: Use force_sig_fault where appropriate (diff)
signal/hexagon: Use force_sig_fault as appropriate
Filling in struct siginfo before calling force_sig_info a tedious and error prone process, where once in a great while the wrong fields are filled out, and siginfo has been inconsistently cleared. Simplify this process by using the helper force_sig_fault. Which takes as a parameters all of the information it needs, ensures all of the fiddly bits of filling in struct siginfo are done properly and then calls force_sig_info. In short about a 5 line reduction in code for every time force_sig_info is called, which makes the calling function clearer. Cc: Richard Kuo <rkuo@codeaurora.org> Cc: linux-hexagon@vger.kernel.org Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'arch/hexagon/kernel')
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/hexagon/kernel/traps.c b/arch/hexagon/kernel/traps.c
index 1ff6a6a7b97c..91ee04842c22 100644
--- a/arch/hexagon/kernel/traps.c
+++ b/arch/hexagon/kernel/traps.c
@@ -412,11 +412,6 @@ void do_trap0(struct pt_regs *regs)
/* Trap0 0xdb is debug breakpoint */
if (user_mode(regs)) {
- struct siginfo info;
- clear_siginfo(&info);
- info.si_signo = SIGTRAP;
- info.si_errno = 0;
* Some architecures add some per-thread state
* to distinguish between breakpoint traps and
@@ -424,9 +419,8 @@ void do_trap0(struct pt_regs *regs)
* set the si_code value appropriately, or we
* may want to use a different trap0 flavor.
- info.si_code = TRAP_BRKPT;
- info.si_addr = (void __user *) pt_elr(regs);
- force_sig_info(SIGTRAP, &info, current);
+ force_sig_fault(SIGTRAP, TRAP_BRKPT,
+ (void __user *) pt_elr(regs), current);
} else {
kgdb_handle_exception(pt_cause(regs), SIGTRAP,