Skip to content

Commit 73851fb

Browse files
Remove unwanted volatile keyword (#1028)
* Remove unwanted volatile keyword * Declare variable initially
1 parent 2829f3e commit 73851fb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tasks.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
985985
UBaseType_t uxCurrentPriority = uxTopReadyPriority;
986986
BaseType_t xTaskScheduled = pdFALSE;
987987
BaseType_t xDecrementTopPriority = pdTRUE;
988+
TCB_t * pxTCB = NULL;
988989

989990
#if ( configUSE_CORE_AFFINITY == 1 )
990991
const TCB_t * pxPreviousTCB = NULL;
@@ -1043,7 +1044,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
10431044
/* MISRA Ref 11.5.3 [Void pointer assignment] */
10441045
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
10451046
/* coverity[misra_c_2012_rule_11_5_violation] */
1046-
TCB_t * pxTCB = ( TCB_t * ) listGET_LIST_ITEM_OWNER( pxIterator );
1047+
pxTCB = ( TCB_t * ) listGET_LIST_ITEM_OWNER( pxIterator );
10471048

10481049
#if ( configRUN_MULTIPLE_PRIORITIES == 0 )
10491050
{
@@ -4181,6 +4182,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery )
41814182
const char pcNameToQuery[] )
41824183
{
41834184
TCB_t * pxReturn = NULL;
4185+
TCB_t * pxTCB = NULL;
41844186
UBaseType_t x;
41854187
char cNextChar;
41864188
BaseType_t xBreakLoop;
@@ -4196,7 +4198,7 @@ char * pcTaskGetName( TaskHandle_t xTaskToQuery )
41964198
/* MISRA Ref 11.5.3 [Void pointer assignment] */
41974199
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/MISRA.md#rule-115 */
41984200
/* coverity[misra_c_2012_rule_11_5_violation] */
4199-
TCB_t * pxTCB = listGET_LIST_ITEM_OWNER( pxIterator );
4201+
pxTCB = listGET_LIST_ITEM_OWNER( pxIterator );
42004202

42014203
/* Check each character in the name looking for a match or
42024204
* mismatch. */
@@ -6255,10 +6257,10 @@ static void prvCheckTasksWaitingTermination( void )
62556257
List_t * pxList,
62566258
eTaskState eState )
62576259
{
6258-
configLIST_VOLATILE TCB_t * pxTCB;
62596260
UBaseType_t uxTask = 0;
62606261
const ListItem_t * pxEndMarker = listGET_END_MARKER( pxList );
62616262
ListItem_t * pxIterator;
6263+
TCB_t * pxTCB = NULL;
62626264

62636265
if( listCURRENT_LIST_LENGTH( pxList ) > ( UBaseType_t ) 0 )
62646266
{

0 commit comments

Comments
 (0)