Skip to content

Commit 52559f4

Browse files
Declare uxCurrentListLength at top of function, update comment.
1 parent 47469bf commit 52559f4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tasks.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3106,6 +3106,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
31063106
void vTaskSuspend( TaskHandle_t xTaskToSuspend )
31073107
{
31083108
TCB_t * pxTCB;
3109+
UBaseType_t uxCurrentListLength;
31093110

31103111
traceENTER_vTaskSuspend( xTaskToSuspend );
31113112

@@ -3190,8 +3191,9 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
31903191
* must be adjusted to point to a different task. */
31913192

31923193
/* Use temp variable as distinct sequence points for reading
3193-
* volatile variables prior to a comparison, per the coding guidelines */
3194-
UBaseType_t uxCurrentListLength = listCURRENT_LIST_LENGTH( &xSuspendedTaskList );
3194+
* volatile variables prior to a comparison to ensure compliance
3195+
* with MISRA C 2012 Rule 13.2. */
3196+
uxCurrentListLength = listCURRENT_LIST_LENGTH( &xSuspendedTaskList );
31953197

31963198
if( uxCurrentListLength == uxCurrentNumberOfTasks )
31973199
{

0 commit comments

Comments
 (0)