From 3950f664ddf198d1a677e54c8be5aa8aff46d0c8 Mon Sep 17 00:00:00 2001 From: Bradley Bolen Date: Fri, 17 May 2019 10:20:01 -0400 Subject: [PATCH] arch: arc: Fix checks of CONFIG_USERSPACE The compiler generates errors of the form error: "CONFIG_USERSPACE" 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 --- arch/arc/core/reset.S | 2 +- arch/arc/core/thread.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arc/core/reset.S b/arch/arc/core/reset.S index f0cce435d11..304447483cd 100644 --- a/arch/arc/core/reset.S +++ b/arch/arc/core/reset.S @@ -66,7 +66,7 @@ SECTION_FUNC(TEXT,__start) /* \todo: MPU init, gp for small data? */ -#if CONFIG_USERSPACE +#if defined(CONFIG_USERSPACE) lr r0, [_ARC_V2_STATUS32] bset r0, r0, _ARC_V2_STATUS32_US_BIT kflag r0 diff --git a/arch/arc/core/thread.c b/arch/arc/core/thread.c index 1936a87a465..1e7b2df5f7a 100644 --- a/arch/arc/core/thread.c +++ b/arch/arc/core/thread.c @@ -74,7 +74,7 @@ void z_new_thread(struct k_thread *thread, k_thread_stack_t *stack, char *stackAdjEnd; struct init_stack_frame *pInitCtx; -#if CONFIG_USERSPACE +#ifdef CONFIG_USERSPACE size_t stackAdjSize; size_t offset = 0;