]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
x86, asm: Use CC_SET()/CC_OUT() and static_cpu_has() in archrandom.h
authorH. Peter Anvin <hpa@linux.intel.com>
Wed, 8 Jun 2016 19:38:46 +0000 (12:38 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Wed, 8 Jun 2016 19:41:20 +0000 (12:41 -0700)
commit3b290398638ee4e57f1fb2e35c02005cba9a737f
tree4babf5ed2e56fba232abe214a5af5af4a8121f00
parent66928b4eb92dfb6d87c204238057b9278b36452b
x86, asm: Use CC_SET()/CC_OUT() and static_cpu_has() in archrandom.h

Use CC_SET()/CC_OUT() and static_cpu_has().  This produces code good
enough to eliminate ad hoc use of alternatives in <asm/archrandom.h>,
greatly simplifying the code.

While we are at it, make x86_init_rdrand() compile out completely if
we don't need it.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/r/1465414726-197858-11-git-send-email-hpa@linux.intel.com
v2: fix a conflict between <linux/random.h> and <asm/archrandom.h>
    discovered by Ingo Molnar.  There are a few places in x86-specific
    code where we need all of <arch/archrandom.h> even when
    CONFIG_ARCH_RANDOM is disabled, so <linux/random.h> does not
    suffice.
arch/x86/include/asm/archrandom.h
arch/x86/kernel/cpu/rdrand.c