diff --git a/components/fatfs/diskio/diskio_rawflash.c b/components/fatfs/diskio/diskio_rawflash.c index 01fc05b90e..382e532393 100644 --- a/components/fatfs/diskio/diskio_rawflash.c +++ b/components/fatfs/diskio/diskio_rawflash.c @@ -18,6 +18,7 @@ #include "ff.h" #include "esp_log.h" #include "diskio_rawflash.h" +#include "esp_compiler.h" static const char* TAG = "diskio_rawflash"; diff --git a/components/fatfs/diskio/diskio_rawflash.h b/components/fatfs/diskio/diskio_rawflash.h index 48d2dd76e0..73ff15f881 100644 --- a/components/fatfs/diskio/diskio_rawflash.h +++ b/components/fatfs/diskio/diskio_rawflash.h @@ -20,7 +20,6 @@ extern "C" { #endif #include "esp_partition.h" -#include "esp_compiler.h" /** * Register spi flash partition diff --git a/components/fatfs/diskio/diskio_sdmmc.c b/components/fatfs/diskio/diskio_sdmmc.c index b1230f1a34..15e4a8677e 100644 --- a/components/fatfs/diskio/diskio_sdmmc.c +++ b/components/fatfs/diskio/diskio_sdmmc.c @@ -17,6 +17,7 @@ #include "ff.h" #include "sdmmc_cmd.h" #include "esp_log.h" +#include "esp_compiler.h" static sdmmc_card_t* s_cards[FF_VOLUMES] = { NULL }; diff --git a/components/fatfs/diskio/diskio_sdmmc.h b/components/fatfs/diskio/diskio_sdmmc.h index 6036ab215d..d7a50221bd 100644 --- a/components/fatfs/diskio/diskio_sdmmc.h +++ b/components/fatfs/diskio/diskio_sdmmc.h @@ -16,7 +16,6 @@ #include "sdmmc_cmd.h" #include "driver/sdmmc_host.h" -#include "esp_compiler.h" #ifdef __cplusplus extern "C" { diff --git a/components/fatfs/diskio/diskio_wl.c b/components/fatfs/diskio/diskio_wl.c index 5b1a5e6ddf..617236e8f7 100644 --- a/components/fatfs/diskio/diskio_wl.c +++ b/components/fatfs/diskio/diskio_wl.c @@ -19,6 +19,7 @@ #include "esp_log.h" #include "diskio_wl.h" #include "wear_levelling.h" +#include "esp_compiler.h" static const char* TAG = "ff_diskio_spiflash"; diff --git a/components/fatfs/diskio/diskio_wl.h b/components/fatfs/diskio/diskio_wl.h index bb5f1a9d69..af3f147973 100644 --- a/components/fatfs/diskio/diskio_wl.h +++ b/components/fatfs/diskio/diskio_wl.h @@ -20,7 +20,6 @@ extern "C" { #endif #include "wear_levelling.h" -#include "esp_compiler.h" /** diff --git a/components/freertos/event_groups.c b/components/freertos/event_groups.c index 7b724891ec..3a06e23740 100644 --- a/components/freertos/event_groups.c +++ b/components/freertos/event_groups.c @@ -444,7 +444,7 @@ BaseType_t xTimeoutOccurred = pdFALSE; event list item, and they should now be retrieved then cleared. */ uxReturn = uxTaskResetEventItemValue(); - if( unlikely (( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0) ) + if( ( uxReturn & eventUNBLOCKED_DUE_TO_BIT_SET ) == ( EventBits_t ) 0 ) { taskENTER_CRITICAL( &pxEventBits->eventGroupMux ); { diff --git a/components/freertos/list.c b/components/freertos/list.c index a1aee58d9e..7081633884 100644 --- a/components/freertos/list.c +++ b/components/freertos/list.c @@ -216,7 +216,7 @@ List_t * const pxList = ( List_t * ) pxItemToRemove->pvContainer; pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext; /* Make sure the index is left pointing to a valid item. */ - if(likely(pxList->pxIndex == pxItemToRemove)) + if(pxList->pxIndex == pxItemToRemove) { pxList->pxIndex = pxItemToRemove->pxPrevious; } diff --git a/components/freertos/queue.c b/components/freertos/queue.c index e39e14980d..e0d8738a42 100644 --- a/components/freertos/queue.c +++ b/components/freertos/queue.c @@ -782,7 +782,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue; mtCOVERAGE_TEST_MARKER(); } } - else if(unlikely(xYieldRequired != pdFALSE)) + else if(xYieldRequired != pdFALSE) { /* This path is a special case that will only get executed if the task was holding multiple mutexes @@ -815,7 +815,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue; mtCOVERAGE_TEST_MARKER(); } } - else if(unlikely(xYieldRequired != pdFALSE)) + else if(xYieldRequired != pdFALSE) { /* This path is a special case that will only get executed if the task was holding multiple mutexes and @@ -868,7 +868,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue; taskENTER_CRITICAL(&pxQueue->mux); /* Update the timeout state to see if it has expired yet. */ - if(likely(xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )) + if(xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE ) { if( prvIsQueueFull( pxQueue ) != pdFALSE ) { @@ -1573,7 +1573,7 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue; taskENTER_CRITICAL(&pxQueue->mux); /* Update the timeout state to see if it has expired yet. */ - if(likely(xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE)) + if(xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE) { if( prvIsQueueEmpty( pxQueue ) != pdFALSE ) { @@ -1888,7 +1888,7 @@ BaseType_t xReturn = pdFALSE; } #endif /* configUSE_MUTEXES */ } - else if(likely(xPosition == queueSEND_TO_BACK)) + else if(xPosition == queueSEND_TO_BACK) { ( void ) memcpy( ( void * ) pxQueue->pcWriteTo, pvItemToQueue, ( size_t ) pxQueue->uxItemSize ); /*lint !e961 !e418 MISRA exception as the casts are only redundant for some ports, plus previous logic ensures a null pointer can only be passed to memcpy() if the copy size is 0. */ pxQueue->pcWriteTo += pxQueue->uxItemSize; diff --git a/components/freertos/tasks.c b/components/freertos/tasks.c index ec0a8c5f20..564b4aa4b2 100644 --- a/components/freertos/tasks.c +++ b/components/freertos/tasks.c @@ -2467,7 +2467,7 @@ BaseType_t xSwitchRequired = pdFALSE; /* Only allow core 0 increase the tick count in the case of xPortSysTickHandler processing. */ /* And allow core 0 and core 1 to unwind uxPendedTicks during xTaskResumeAll. */ - if (likely(xPortInIsrContext())) + if (xPortInIsrContext()) { #if ( configUSE_TICK_HOOK == 1 ) vApplicationTickHook(); @@ -4188,7 +4188,7 @@ For ESP32 FreeRTOS, vTaskEnterCritical implements both portENTER_CRITICAL and po { BaseType_t oldInterruptLevel=0; BaseType_t schedulerRunning = xSchedulerRunning; - if(likely(schedulerRunning != pdFALSE)) + if(schedulerRunning != pdFALSE) { //Interrupts may already be disabled (because we're doing this recursively) but we can't get the interrupt level after //vPortCPUAquireMutex, because it also may mess with interrupts. Get it here first, then later figure out if we're nesting @@ -4201,7 +4201,7 @@ For ESP32 FreeRTOS, vTaskEnterCritical implements both portENTER_CRITICAL and po vPortCPUAcquireMutexIntsDisabled( mux, portMUX_NO_TIMEOUT ); #endif - if(likely(schedulerRunning != pdFALSE)) + if(schedulerRunning != pdFALSE) { TCB_t *tcb = pxCurrentTCB[xPortGetCoreID()]; BaseType_t newNesting = tcb->uxCriticalNesting + 1; @@ -4260,11 +4260,11 @@ For ESP32 FreeRTOS, vTaskExitCritical implements both portEXIT_CRITICAL and port #else vPortCPUReleaseMutexIntsDisabled( mux ); #endif - if(likely(xSchedulerRunning != pdFALSE)) + if(xSchedulerRunning != pdFALSE) { TCB_t *tcb = pxCurrentTCB[xPortGetCoreID()]; BaseType_t nesting = tcb->uxCriticalNesting; - if(likely(nesting > 0U)) + if(nesting > 0U) { nesting--; tcb->uxCriticalNesting = nesting; diff --git a/components/freertos/timers.c b/components/freertos/timers.c index 125a5357f3..3a86b65094 100644 --- a/components/freertos/timers.c +++ b/components/freertos/timers.c @@ -410,7 +410,7 @@ DaemonTaskMessage_t xMessage; /* Send a message to the timer service task to perform a particular action on a particular timer definition. */ - if(unlikely( xTimerQueue != NULL )) + if( xTimerQueue != NULL ) { /* Send a command to the timer service task to start the xTimer timer. */ xMessage.xMessageID = xCommandID; @@ -725,7 +725,7 @@ TickType_t xTimeNow; /* Commands that are positive are timer commands rather than pended function calls. */ - if(likely( xMessage.xMessageID >= ( BaseType_t ) 0) ) + if( xMessage.xMessageID >= ( BaseType_t ) 0 ) { /* The messages uses the xTimerParameters member to work on a software timer. */ @@ -759,7 +759,7 @@ TickType_t xTimeNow; case tmrCOMMAND_RESET_FROM_ISR : case tmrCOMMAND_START_DONT_TRACE : /* Start or restart a timer. */ - if(likely( prvInsertTimerInActiveList( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow, xMessage.u.xTimerParameters.xMessageValue ) == pdTRUE )) + if( prvInsertTimerInActiveList( pxTimer, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow, xMessage.u.xTimerParameters.xMessageValue ) == pdTRUE ) { /* The timer expired before it was added to the active timer list. Process it now. */