]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit44df2718fe6e2a5c5ab2f1d346be6f1f7a1380bc
tree269b9169b6427df0eca8f3883aa426a9dd98e6fe
parent1bb4fa25a0d30d57061d13bc0920230e933ec559
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