From bf475d92c6216fcebfe0d25ecbc1a88bad5f5567 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 13 Jun 2021 09:25:32 +0000 Subject: [PATCH] MISRA-related fixes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14543 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- doc/nil/reports/misra.txt | 3 +++ os/common/ports/ARMv6-M-RP2/chcore.h | 4 ++-- os/common/ports/ARMv6-M/chcore.h | 4 ++-- os/common/ports/ARMv7-M/chcore.h | 6 +++--- os/common/ports/ARMv8-M-ML/chcore.h | 4 ++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/doc/nil/reports/misra.txt b/doc/nil/reports/misra.txt index 219910ad1..cc2d90b85 100644 --- a/doc/nil/reports/misra.txt +++ b/doc/nil/reports/misra.txt @@ -22,3 +22,6 @@ --- Module: ..\..\..\os\oslib\src\chdelegates.c (C) --- Module: ..\..\..\os\oslib\src\chfactory.c (C) + +executed 6-13-2021 + diff --git a/os/common/ports/ARMv6-M-RP2/chcore.h b/os/common/ports/ARMv6-M-RP2/chcore.h index 67965c3e2..9e6ffd60c 100644 --- a/os/common/ports/ARMv6-M-RP2/chcore.h +++ b/os/common/ports/ARMv6-M-RP2/chcore.h @@ -375,7 +375,7 @@ struct port_context { (tp)->ctx.sp->r4 = (uint32_t)(pf); \ (tp)->ctx.sp->r5 = (uint32_t)(arg); \ (tp)->ctx.sp->lr = (uint32_t)__port_thread_start; \ -} while (0) +} while (false) /** * @brief Computes the thread working area global size. @@ -460,7 +460,7 @@ struct port_context { chSysHalt("stack overflow"); \ } \ __port_switch(ntp, otp); \ - } while (0) + } while (false) #endif /** diff --git a/os/common/ports/ARMv6-M/chcore.h b/os/common/ports/ARMv6-M/chcore.h index 7e49ff15e..18fc79ea4 100644 --- a/os/common/ports/ARMv6-M/chcore.h +++ b/os/common/ports/ARMv6-M/chcore.h @@ -334,7 +334,7 @@ struct port_context { (tp)->ctx.sp->r4 = (uint32_t)(pf); \ (tp)->ctx.sp->r5 = (uint32_t)(arg); \ (tp)->ctx.sp->lr = (uint32_t)__port_thread_start; \ -} while (0) +} while (false) /** * @brief Computes the thread working area global size. @@ -419,7 +419,7 @@ struct port_context { chSysHalt("stack overflow"); \ } \ __port_switch(ntp, otp); \ - } while (0) + } while (false) #endif /*===========================================================================*/ diff --git a/os/common/ports/ARMv7-M/chcore.h b/os/common/ports/ARMv7-M/chcore.h index 293dc5f51..57fa43704 100644 --- a/os/common/ports/ARMv7-M/chcore.h +++ b/os/common/ports/ARMv7-M/chcore.h @@ -604,7 +604,7 @@ struct port_context { (tp)->ctx.sp->lr = (uint32_t)__port_thread_start; \ __PORT_SETUP_CONTEXT_MPU(tp); \ __PORT_SETUP_CONTEXT_SYSCALL(tp, wtop); \ -} while (0) +} while (false) /** * @brief Context switch area size. @@ -703,7 +703,7 @@ struct port_context { chSysHalt("stack overflow"); \ } \ __port_switch(ntp, otp); \ - } while (0) + } while (false) #else #define port_switch(ntp, otp) do { \ @@ -712,7 +712,7 @@ struct port_context { /* Setting up the guard page for the switched-in thread.*/ \ mpuSetRegionAddress(PORT_USE_GUARD_MPU_REGION, \ chThdGetSelfX()->wabase); \ - } while (0) + } while (false) #endif #endif diff --git a/os/common/ports/ARMv8-M-ML/chcore.h b/os/common/ports/ARMv8-M-ML/chcore.h index 423543706..4adc61fc7 100644 --- a/os/common/ports/ARMv8-M-ML/chcore.h +++ b/os/common/ports/ARMv8-M-ML/chcore.h @@ -435,7 +435,7 @@ struct port_context { PORT_SETUP_CONTEXT_SPLIM(tp, wbase); \ PORT_SETUP_CONTEXT_FPU(tp); \ PORT_SETUP_CONTEXT_MPU(tp); \ -} while (0) +} while (false) /** * @brief Computes the thread working area global size. @@ -515,7 +515,7 @@ struct port_context { chSysHalt("stack overflow"); \ } \ __port_switch(ntp, otp); \ - } while (0) + } while (false) #endif /*===========================================================================*/