From ca7ee4c7b2e17194d2d1db5d4dca2e185f4aa8ca Mon Sep 17 00:00:00 2001 From: Rahul Kar Date: Thu, 19 Oct 2023 14:20:35 +0000 Subject: [PATCH 1/3] Wrap macro parameter expansion by parantheses --- stream_buffer.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/stream_buffer.c b/stream_buffer.c index 32aa8e4f2b3..27ad0b9ab0b 100644 --- a/stream_buffer.c +++ b/stream_buffer.c @@ -153,16 +153,16 @@ * invoke the callback else use the send complete macro which is provided by default for all instances. */ #if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) - #define prvSEND_COMPLETED( pxStreamBuffer ) \ - do { \ - if( ( pxStreamBuffer )->pxSendCompletedCallback != NULL ) \ - { \ - pxStreamBuffer->pxSendCompletedCallback( ( pxStreamBuffer ), pdFALSE, NULL ); \ - } \ - else \ - { \ - sbSEND_COMPLETED( ( pxStreamBuffer ) ); \ - } \ + #define prvSEND_COMPLETED( pxStreamBuffer ) \ + do { \ + if( ( pxStreamBuffer )->pxSendCompletedCallback != NULL ) \ + { \ + ( pxStreamBuffer )->pxSendCompletedCallback( ( pxStreamBuffer ), pdFALSE, NULL ); \ + } \ + else \ + { \ + sbSEND_COMPLETED( ( pxStreamBuffer ) ); \ + } \ } while( 0 ) #else /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */ #define prvSEND_COMPLETED( pxStreamBuffer ) sbSEND_COMPLETED( ( pxStreamBuffer ) ) From 2a55fbfaeee086199b9d62dbbcfb0c6a41ae589a Mon Sep 17 00:00:00 2001 From: Monika Singh Date: Thu, 26 Oct 2023 06:06:10 +0000 Subject: [PATCH 2/3] Update parantheses in SMP macro definition --- tasks.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks.c b/tasks.c index e941907cf9c..9c310c7a93c 100644 --- a/tasks.c +++ b/tasks.c @@ -326,18 +326,18 @@ * one core to yield. */ #define prvYieldCore( xCoreID ) \ do { \ - if( xCoreID == ( BaseType_t ) portGET_CORE_ID() ) \ + if( ( xCoreID ) == ( BaseType_t ) portGET_CORE_ID() ) \ { \ /* Pending a yield for this core since it is in the critical section. */ \ - xYieldPendings[ xCoreID ] = pdTRUE; \ + xYieldPendings[ ( xCoreID ) ] = pdTRUE; \ } \ else \ { \ /* Request other core to yield if it is not requested before. */ \ - if( pxCurrentTCBs[ xCoreID ]->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD ) \ + if( pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD ) \ { \ portYIELD_CORE( xCoreID ); \ - pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_SCHEDULED_TO_YIELD; \ + pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState = taskTASK_SCHEDULED_TO_YIELD; \ } \ } \ } while( 0 ) From c3f8c1974fb2e9446140fc9799262c32544f1e77 Mon Sep 17 00:00:00 2001 From: Rahul Kar Date: Thu, 26 Oct 2023 06:24:17 +0000 Subject: [PATCH 3/3] Fix formatting --- tasks.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tasks.c b/tasks.c index 9c310c7a93c..3c9c6e6b141 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 { \ + #define prvYieldCore( xCoreID ) \ + do { \ if( ( xCoreID ) == ( BaseType_t ) portGET_CORE_ID() ) \ - { \ - /* Pending a yield for this core since it is in the critical section. */ \ + { \ + /* 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. */ \ + } \ + else \ + { \ + /* Request other core to yield if it is not requested before. */ \ if( pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD ) \ - { \ - portYIELD_CORE( xCoreID ); \ + { \ + portYIELD_CORE( xCoreID ); \ pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState = taskTASK_SCHEDULED_TO_YIELD; \ - } \ - } \ + } \ + } \ } while( 0 ) #endif /* #if ( configNUMBER_OF_CORES > 1 ) */ /*-----------------------------------------------------------*/