uprobes/x86: Make good_insns_* depend on CONFIG_X86_*
authorOleg Nesterov <oleg@redhat.com>
Sat, 19 Apr 2014 14:07:15 +0000 (16:07 +0200)
committerOleg Nesterov <oleg@redhat.com>
Wed, 30 Apr 2014 17:10:35 +0000 (19:10 +0200)
commit8dbacad93a2a12adebcc717e6055b1bcc1739ab8
tree30304d63a8174762bf68e1dc271390c0eaec39ed
parentff261964cfcfe49d73690ca29b0ba2853d9497e3
uprobes/x86: Make good_insns_* depend on CONFIG_X86_*

Add the suitable ifdef's around good_insns_* arrays. We do not want
to add the ugly ifdef's into their only user, uprobe_init_insn(), so
the "#else" branch simply defines them as NULL. This doesn't generate
the extra code, gcc is smart enough, although the code is fine even if
it could not detect that (without CONFIG_IA32_EMULATION) is_64bit_mm()
is __builtin_constant_p().

The patch looks more complicated because it also moves good_insns_64
up close to good_insns_32.

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