arm64: kernel: Add optional CONFIG_ parameter to ALTERNATIVE()
authorJames Morse <james.morse@arm.com>
Tue, 21 Jul 2015 12:23:30 +0000 (13:23 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 27 Jul 2015 10:08:41 +0000 (11:08 +0100)
commit91a5cefa2f98bdd3404c2fba57048c4fa225cc37
tree269b9169b6427df0eca8f3883aa426a9dd98e6fe
parent18ffa046c509d0cd011eeea2c0418f2d014771fc
arm64: kernel: Add optional CONFIG_ parameter to ALTERNATIVE()

Some uses of ALTERNATIVE() may depend on a feature that is disabled at
compile time by a Kconfig option. In this case the unused alternative
instructions waste space, and if the original instruction is a nop, it
wastes time and space.

This patch adds an optional 'config' option to ALTERNATIVE() and
alternative_insn that allows the compiler to remove both the original
and alternative instructions if the config option is not defined.

Suggested-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/alternative.h