Skip to content
Permalink
Browse files

arch: arm: Fix checks of CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT

The compiler generates errors of the form
error: "CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT" is not defined,
evaluates to 0 [-Werror=undef]
when -Wundef is used and the config option was turned off.  Change
check to if defined().

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
  • Loading branch information...
Bradley Bolen authored and nashif committed May 17, 2019
1 parent 5c8faf8 commit f888f9ab2779f36569fe7b6990a7b99169cd7798
Showing with 2 additions and 1 deletion.
  1. +2 −1 arch/arm/core/thread.c
@@ -85,7 +85,8 @@ void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
#endif /* CONFIG_THREAD_USERSPACE_LOCAL_DATA */
#endif /* CONFIG_USERSPACE */

#if CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT && defined(CONFIG_USERSPACE)
#if defined(CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT) \
&& defined(CONFIG_USERSPACE)
/* This is required to work-around the case where the thread
* is created without using K_THREAD_STACK_SIZEOF() macro in
* k_thread_create(). If K_THREAD_STACK_SIZEOF() is used, the

0 comments on commit f888f9a

Please sign in to comment.
You can’t perform that action at this time.