x86/traps: Introduce fill_trap_info(), simplify DO_ERROR_INFO()
authorOleg Nesterov <oleg@redhat.com>
Wed, 7 May 2014 15:59:39 +0000 (17:59 +0200)
committerOleg Nesterov <oleg@redhat.com>
Wed, 14 May 2014 11:57:27 +0000 (13:57 +0200)
commit958d3d729802f7d741cbe8400e69b89baae580ee
tree3ed3667300363041c3e81a583db877807ee57589
parentdff0796e53c29147c9bd1f5567a261dcf0e528bc
x86/traps: Introduce fill_trap_info(), simplify DO_ERROR_INFO()

Extract the fill-siginfo code from DO_ERROR_INFO() into the new helper,
fill_trap_info().

It can calculate si_code and si_addr looking at trapnr, so we can remove
these arguments from DO_ERROR_INFO() and simplify the source code. The
generated code is the same, __builtin_constant_p(trapnr) == T.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
arch/x86/kernel/traps.c