arm: mm: Fix build error due to variable input to BUILD_BUG_ON
BUILD_BUG_ON() expands to a build error based on value of
constant bool parameter passed to it. Presently,
early_fixmap_shutdown while iterating through
permanent_fixed_address and calling fix_to_virt on each of
them, ends up passing non-constant value to the same.
It is observed that with '-Oz' build option LLVM compiler
fails to guess the right value to expand BUILD_BUG_ON and
incorrectly raises following error.
arch/arm/mm/mmu.o: In function `fix_to_virt':
include/asm-generic/fixmap.h:31:
undefined reference to `__compiletime_assert_31'
make[2]: *** [vmlinux] Error 1
make[2]: Leaving directory
`build/kobj'
make[1]: *** [sub-make] Error 2
Modify early_fixmap_shutdown to bypass fix_to_virt and
directly use __fixt_to_virt and validate boundaries,
passing constant values to BUILD_BUG_ON.
Change-Id: Ib0bd771ec0bdae0fbc00ed0c0df8f716cc0386b5
Signed-off-by:
Shiraz Hashim <shashim@codeaurora.org>
Loading
Please register or sign in to comment