Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FreeRTOS/FreeRTOS-Kernel.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Kar <118818625+kar-rahul-aws@users.noreply.github.com>2023-12-06 11:27:10 +0300
committerGitHub <noreply@github.com>2023-12-06 11:27:10 +0300
commitedce1e94b3ab06000e99727897f51a5845bbba16 (patch)
tree7f116a4b82d9b42a93dcd80b72137002b32a5765 /tasks.c
parent84c0047ccd8bfa1936eace051be9f72f950372ab (diff)
Fix MISRA_C_2012 rule 20.7 violation (#843)
* Wrap macro parameter expansion by parentheses * Update parentheses in SMP macro definition --------- Co-authored-by: Soren Ptak <ptaksoren@gmail.com> Co-authored-by: Monika Singh <moninom@amazon.com> Co-authored-by: chinglee-iot <61685396+chinglee-iot@users.noreply.github.com>
Diffstat (limited to 'tasks.c')
-rw-r--r--tasks.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/tasks.c b/tasks.c
index a9427539a..8f691d117 100644
--- a/tasks.c
+++ b/tasks.c
@@ -324,22 +324,22 @@
/* Yields the given core. This must be called from a critical section and xCoreID
* must be valid. This macro is not required in single core since there is only
* one core to yield. */
- #define prvYieldCore( xCoreID ) \
- do { \
- if( xCoreID == ( BaseType_t ) portGET_CORE_ID() ) \
- { \
- /* Pending a yield for this core since it is in the critical section. */ \
- xYieldPendings[ xCoreID ] = pdTRUE; \
- } \
- else \
- { \
- /* Request other core to yield if it is not requested before. */ \
- if( pxCurrentTCBs[ xCoreID ]->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD ) \
- { \
- portYIELD_CORE( xCoreID ); \
- pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_SCHEDULED_TO_YIELD; \
- } \
- } \
+ #define prvYieldCore( xCoreID ) \
+ do { \
+ if( ( xCoreID ) == ( BaseType_t ) portGET_CORE_ID() ) \
+ { \
+ /* Pending a yield for this core since it is in the critical section. */ \
+ xYieldPendings[ ( xCoreID ) ] = pdTRUE; \
+ } \
+ else \
+ { \
+ /* Request other core to yield if it is not requested before. */ \
+ if( pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD ) \
+ { \
+ portYIELD_CORE( xCoreID ); \
+ pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState = taskTASK_SCHEDULED_TO_YIELD; \
+ } \
+ } \
} while( 0 )
#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
/*-----------------------------------------------------------*/