Skip to content

Commit edce1e9

Browse files
kar-rahul-awsSkptakmoninom1chinglee-iot
authored
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 <[email protected]> Co-authored-by: Monika Singh <[email protected]> Co-authored-by: chinglee-iot <[email protected]>
1 parent 84c0047 commit edce1e9

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

stream_buffer.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,16 @@
153153
* invoke the callback else use the send complete macro which is provided by default for all instances.
154154
*/
155155
#if ( configUSE_SB_COMPLETED_CALLBACK == 1 )
156-
#define prvSEND_COMPLETED( pxStreamBuffer ) \
157-
do { \
158-
if( ( pxStreamBuffer )->pxSendCompletedCallback != NULL ) \
159-
{ \
160-
pxStreamBuffer->pxSendCompletedCallback( ( pxStreamBuffer ), pdFALSE, NULL ); \
161-
} \
162-
else \
163-
{ \
164-
sbSEND_COMPLETED( ( pxStreamBuffer ) ); \
165-
} \
156+
#define prvSEND_COMPLETED( pxStreamBuffer ) \
157+
do { \
158+
if( ( pxStreamBuffer )->pxSendCompletedCallback != NULL ) \
159+
{ \
160+
( pxStreamBuffer )->pxSendCompletedCallback( ( pxStreamBuffer ), pdFALSE, NULL ); \
161+
} \
162+
else \
163+
{ \
164+
sbSEND_COMPLETED( ( pxStreamBuffer ) ); \
165+
} \
166166
} while( 0 )
167167
#else /* if ( configUSE_SB_COMPLETED_CALLBACK == 1 ) */
168168
#define prvSEND_COMPLETED( pxStreamBuffer ) sbSEND_COMPLETED( ( pxStreamBuffer ) )

tasks.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -324,22 +324,22 @@
324324
/* Yields the given core. This must be called from a critical section and xCoreID
325325
* must be valid. This macro is not required in single core since there is only
326326
* one core to yield. */
327-
#define prvYieldCore( xCoreID ) \
328-
do { \
329-
if( xCoreID == ( BaseType_t ) portGET_CORE_ID() ) \
330-
{ \
331-
/* Pending a yield for this core since it is in the critical section. */ \
332-
xYieldPendings[ xCoreID ] = pdTRUE; \
333-
} \
334-
else \
335-
{ \
336-
/* Request other core to yield if it is not requested before. */ \
337-
if( pxCurrentTCBs[ xCoreID ]->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD ) \
338-
{ \
339-
portYIELD_CORE( xCoreID ); \
340-
pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_SCHEDULED_TO_YIELD; \
341-
} \
342-
} \
327+
#define prvYieldCore( xCoreID ) \
328+
do { \
329+
if( ( xCoreID ) == ( BaseType_t ) portGET_CORE_ID() ) \
330+
{ \
331+
/* Pending a yield for this core since it is in the critical section. */ \
332+
xYieldPendings[ ( xCoreID ) ] = pdTRUE; \
333+
} \
334+
else \
335+
{ \
336+
/* Request other core to yield if it is not requested before. */ \
337+
if( pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD ) \
338+
{ \
339+
portYIELD_CORE( xCoreID ); \
340+
pxCurrentTCBs[ ( xCoreID ) ]->xTaskRunState = taskTASK_SCHEDULED_TO_YIELD; \
341+
} \
342+
} \
343343
} while( 0 )
344344
#endif /* #if ( configNUMBER_OF_CORES > 1 ) */
345345
/*-----------------------------------------------------------*/

0 commit comments

Comments
 (0)