x86: traps_xx: modify do_trap

if (cond) block -> if (!cond) goto end_of_block

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Alexander van Heukelum 2008-07-02 01:31:34 +02:00 committed by Ingo Molnar
parent e423f49fc8
commit a7bbb0ce1d

View File

@ -630,38 +630,38 @@ do_trap(int trapnr, int signr, char *str, struct pt_regs *regs,
{ {
struct task_struct *tsk = current; struct task_struct *tsk = current;
if (user_mode(regs)) { if (!user_mode(regs))
/* goto kernel_trap;
* We want error_code and trap_no set for userspace
* faults and kernelspace faults which result in
* die(), but not kernelspace faults which are fixed
* up. die() gives the process no chance to handle
* the signal and notice the kernel fault information,
* so that won't result in polluting the information
* about previously queued, but not yet delivered,
* faults. See also do_general_protection below.
*/
tsk->thread.error_code = error_code;
tsk->thread.trap_no = trapnr;
if (show_unhandled_signals && unhandled_signal(tsk, signr) && /*
printk_ratelimit()) { * We want error_code and trap_no set for userspace faults and
printk(KERN_INFO * kernelspace faults which result in die(), but not
"%s[%d] trap %s ip:%lx sp:%lx error:%lx", * kernelspace faults which are fixed up. die() gives the
tsk->comm, tsk->pid, str, * process no chance to handle the signal and notice the
regs->ip, regs->sp, error_code); * kernel fault information, so that won't result in polluting
print_vma_addr(" in ", regs->ip); * the information about previously queued, but not yet
printk("\n"); * delivered, faults. See also do_general_protection below.
} */
tsk->thread.error_code = error_code;
tsk->thread.trap_no = trapnr;
if (info) if (show_unhandled_signals && unhandled_signal(tsk, signr) &&
force_sig_info(signr, info, tsk); printk_ratelimit()) {
else printk(KERN_INFO
force_sig(signr, tsk); "%s[%d] trap %s ip:%lx sp:%lx error:%lx",
return; tsk->comm, tsk->pid, str,
regs->ip, regs->sp, error_code);
print_vma_addr(" in ", regs->ip);
printk("\n");
} }
if (info)
force_sig_info(signr, info, tsk);
else
force_sig(signr, tsk);
return;
kernel_trap:
if (!fixup_exception(regs)) { if (!fixup_exception(regs)) {
tsk->thread.error_code = error_code; tsk->thread.error_code = error_code;
tsk->thread.trap_no = trapnr; tsk->thread.trap_no = trapnr;