From 3daa18b661c5e01dd3d2f2408478faac7ea01f59 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 7 Jul 2022 11:02:56 +0800 Subject: [PATCH] arch: Remove the unnecessary #if/#endif in assert Signed-off-by: Xiang Xiao --- arch/arm/src/common/arm_assert.c | 13 +++++-------- arch/risc-v/src/common/riscv_assert.c | 13 +++++-------- arch/xtensa/src/common/xtensa_dumpstate.c | 15 +++++---------- 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/arch/arm/src/common/arm_assert.c b/arch/arm/src/common/arm_assert.c index 77c4195763..7098c3eaf3 100644 --- a/arch/arm/src/common/arm_assert.c +++ b/arch/arm/src/common/arm_assert.c @@ -284,20 +284,17 @@ static void arm_showtasks(void) # ifdef CONFIG_SMP " ----" # endif - " %7lu" + " %7u" # ifdef CONFIG_STACK_COLORATION - " %7lu %3" PRId32 ".%1" PRId32 "%%%c" + " %7" PRId32 " %3" PRId32 ".%1" PRId32 "%%%c" # endif # ifdef CONFIG_SCHED_CPULOAD " ----" # endif -# if CONFIG_TASK_NAME_SIZE > 0 - " irq" -# endif - "\n" - , (unsigned long)(CONFIG_ARCH_INTERRUPTSTACK & ~7) + " irq\n" + , (CONFIG_ARCH_INTERRUPTSTACK & ~7) # ifdef CONFIG_STACK_COLORATION - , (unsigned long)stack_used + , stack_used , stack_filled / 10, stack_filled % 10, (stack_filled >= 10 * 80 ? '!' : ' ') # endif diff --git a/arch/risc-v/src/common/riscv_assert.c b/arch/risc-v/src/common/riscv_assert.c index 1cf8524808..1cd757cd59 100644 --- a/arch/risc-v/src/common/riscv_assert.c +++ b/arch/risc-v/src/common/riscv_assert.c @@ -284,20 +284,17 @@ static inline void riscv_showtasks(void) # ifdef CONFIG_SMP " ----" # endif - " %7lu" + " %7u" # ifdef CONFIG_STACK_COLORATION - " %7lu %3" PRId32 ".%1" PRId32 "%%%c" + " %7" PRId32 " %3" PRId32 ".%1" PRId32 "%%%c" # endif # ifdef CONFIG_SCHED_CPULOAD " ----" # endif -# if CONFIG_TASK_NAME_SIZE > 0 - " irq" -# endif - "\n" - , (unsigned long)(CONFIG_ARCH_INTERRUPTSTACK & ~15) + " irq\n" + , (CONFIG_ARCH_INTERRUPTSTACK & ~15) # ifdef CONFIG_STACK_COLORATION - , (unsigned long)stack_used + , stack_used , stack_filled / 10, stack_filled % 10, (stack_filled >= 10 * 80 ? '!' : ' ') # endif diff --git a/arch/xtensa/src/common/xtensa_dumpstate.c b/arch/xtensa/src/common/xtensa_dumpstate.c index 00c38c4cf6..f99a745770 100644 --- a/arch/xtensa/src/common/xtensa_dumpstate.c +++ b/arch/xtensa/src/common/xtensa_dumpstate.c @@ -122,9 +122,7 @@ static void xtensa_dump_task(struct tcb_s *tcb, void *arg) #ifdef CONFIG_SCHED_CPULOAD " %3" PRId32 ".%01" PRId32 "%%" #endif -#if CONFIG_TASK_NAME_SIZE > 0 " %s%s\n" -#endif , tcb->pid, tcb->sched_priority #ifdef CONFIG_SMP , tcb->cpu @@ -201,20 +199,17 @@ static inline void xtensa_showtasks(void) # ifdef CONFIG_SMP " ----" # endif - " %7lu" + " %7u" # ifdef CONFIG_STACK_COLORATION - " %7lu %3" PRId32 ".%1" PRId32 "%%%c" + " %7" PRId32 " %3" PRId32 ".%1" PRId32 "%%%c" # endif # ifdef CONFIG_SCHED_CPULOAD " ----" # endif -# if CONFIG_TASK_NAME_SIZE > 0 - " irq" -# endif - "\n" - , (unsigned long)(CONFIG_ARCH_INTERRUPTSTACK & ~15) + " irq\n" + , (CONFIG_ARCH_INTERRUPTSTACK & ~15) # ifdef CONFIG_STACK_COLORATION - , (unsigned long)stack_used + , stack_used , stack_filled / 10, stack_filled % 10, (stack_filled >= 10 * 80 ? '!' : ' ') # endif