uprobes/x86: Simplify riprel_{pre,post}_xol() and make them similar
authorOleg Nesterov <oleg@redhat.com>
Sun, 27 Apr 2014 16:13:31 +0000 (18:13 +0200)
committerOleg Nesterov <oleg@redhat.com>
Wed, 30 Apr 2014 17:10:41 +0000 (19:10 +0200)
Ignoring the "correction" logic riprel_pre_xol() and riprel_post_xol()
are very similar but look quite differently.

1. Add the "UPROBE_FIX_RIP_AX | UPROBE_FIX_RIP_CX" check at the start
   of riprel_pre_xol(), like the same check in riprel_post_xol().

2. Add the trivial scratch_reg() helper which returns the address of
   scratch register pre_xol/post_xol need to change.

3. Change these functions to use the new helper and avoid copy-and-paste
   under if/else branches.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
arch/x86/kernel/uprobes.c

Simple merge