Re: [PATCH v1 2/4] powerpc/fixmap: Use __fix_to_virt() instead of fix_to_virt()

From: Michael Ellerman
Date: Mon Nov 25 2019 - 05:47:11 EST


On Thu, 2019-09-12 at 13:49:42 UTC, Christophe Leroy wrote:
> Modify back __set_fixmap() to using __fix_to_virt() instead
> of fix_to_virt() otherwise the following happens because it
> seems GCC doesn't see idx as a builtin const.
>
> CC mm/early_ioremap.o
> In file included from ./include/linux/kernel.h:11:0,
> from mm/early_ioremap.c:11:
> In function â??fix_to_virtâ??,
> inlined from â??__set_fixmapâ?? at ./arch/powerpc/include/asm/fixmap.h:87:2,
> inlined from â??__early_ioremapâ?? at mm/early_ioremap.c:156:4:
> ./include/linux/compiler.h:350:38: error: call to â??__compiletime_assert_32â?? declared with attribute error: BUILD_BUG_ON failed: idx >= __end_of_fixed_addresses
> _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
> ^
> ./include/linux/compiler.h:331:4: note: in definition of macro â??__compiletime_assertâ??
> prefix ## suffix(); \
> ^
> ./include/linux/compiler.h:350:2: note: in expansion of macro â??_compiletime_assertâ??
> _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
> ^
> ./include/linux/build_bug.h:39:37: note: in expansion of macro â??compiletime_assertâ??
> #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
> ^
> ./include/linux/build_bug.h:50:2: note: in expansion of macro â??BUILD_BUG_ON_MSGâ??
> BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
> ^
> ./include/asm-generic/fixmap.h:32:2: note: in expansion of macro â??BUILD_BUG_ONâ??
> BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
> ^
>
> Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxx>
> Fixes: 4cfac2f9c7f1 ("powerpc/mm: Simplify __set_fixmap()")

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/77693a5fb57be4606a6024ec8e3076f9499b906b

cheers