mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 17:48:33 -04:00
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>
This commit is contained in:
parent
84c0047ccd
commit
edce1e94b3
2 changed files with 26 additions and 26 deletions
32
tasks.c
32
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 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue