aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/unaligned_32.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2018-04-19 16:57:48 -0500
committerEric W. Biederman <ebiederm@xmission.com>2018-04-25 10:44:09 -0500
commit0e3d9f1e667bddc746112fa927cec9770f1f4217 (patch)
tree463c31883bdc2ac528012d228982983ff143fcc2 /arch/sparc/kernel/unaligned_32.c
parentsignal/sh: Use force_sig_fault where appropriate (diff)
downloadlinux-dev-0e3d9f1e667bddc746112fa927cec9770f1f4217.tar.xz
linux-dev-0e3d9f1e667bddc746112fa927cec9770f1f4217.zip
signal/sparc: Use send_sig_fault where appropriate
Filling in struct siginfo before calling send_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 send_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 send_sig_info. In short about a 5 line reduction in code for every time send_sig_info is called, which makes the calling function clearer. Cc: David Miller <davem@davemloft.net> Cc: sparclinux@vger.kernel.org Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'arch/sparc/kernel/unaligned_32.c')
-rw-r--r--arch/sparc/kernel/unaligned_32.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c
index 0e4cf7217413..64ac8c0c1429 100644
--- a/arch/sparc/kernel/unaligned_32.c
+++ b/arch/sparc/kernel/unaligned_32.c
@@ -311,15 +311,9 @@ static inline int ok_for_user(struct pt_regs *regs, unsigned int insn,
static void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn)
{
- siginfo_t info;
-
- clear_siginfo(&info);
- info.si_signo = SIGBUS;
- info.si_errno = 0;
- info.si_code = BUS_ADRALN;
- info.si_addr = (void __user *)safe_compute_effective_address(regs, insn);
- info.si_trapno = 0;
- send_sig_info(SIGBUS, &info, current);
+ send_sig_fault(SIGBUS, BUS_ADRALN,
+ (void __user *)safe_compute_effective_address(regs, insn),
+ 0, current);
}
asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)