From 66b55a3f7c36a94b71dc99bb0ad759e22a15131d Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Thu, 17 Sep 2015 22:51:21 -0400 Subject: [PATCH] arc: if printk is disabled, do not set variables if printk is disabled, the variables will be unused and we will get compiler warning. Change-Id: I5dad791ae89d7a8c98f9e4660da472ef0caacc92 Signed-off-by: Anas Nashif --- arch/arc/core/fault.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arc/core/fault.c b/arch/arc/core/fault.c index 60c17f11361..42150444d96 100644 --- a/arch/arc/core/fault.c +++ b/arch/arc/core/fault.c @@ -73,6 +73,7 @@ void _FaultDump(const NANO_ESF *esf, int fault) { ARG_UNUSED(esf); +#ifdef CONFIG_PRINTK uint32_t exc_addr = _arc_v2_aux_reg_read(_ARC_V2_EFA); uint32_t ecr = _arc_v2_aux_reg_read(_ARC_V2_ECR); @@ -81,6 +82,7 @@ void _FaultDump(const NANO_ESF *esf, int fault) _ARC_V2_ECR_CODE(ecr), _ARC_V2_ECR_PARAMETER(ecr)); PR_EXC("Address 0x%x\n", exc_addr); +#endif } #endif /* CONFIG_FAULT_DUMP */