Skip to content

Commit

Permalink
Remove TODO words if there is nothing to do. (#1142)
Browse files Browse the repository at this point in the history
* Remove TODO words if there is nothing to do.

* Update LPC54018 comment

Co-authored-by: Monika Singh <moninom@amazon.com>

---------

Co-authored-by: Monika Singh <moninom@amazon.com>
  • Loading branch information
ActoryOu and moninom1 committed May 6, 2024
1 parent 86b16eb commit bffa66f
Show file tree
Hide file tree
Showing 22 changed files with 19 additions and 50 deletions.
1 change: 0 additions & 1 deletion source/FreeRTOS_DNS.c
Expand Up @@ -161,7 +161,6 @@

/** @brief This global variable is being used to indicate to the driver which IP type
* is preferred for name service lookup, either IPv6 or IPv4. */
/* TODO: Fix IPv6 DNS query in Windows Simulator. */
IPPreference_t xDNS_IP_Preference = xPreferenceIPv4;

/*-----------------------------------------------------------*/
Expand Down
5 changes: 2 additions & 3 deletions source/FreeRTOS_DNS_Parser.c
Expand Up @@ -250,7 +250,6 @@
* An error code (dnsPARSE_ERROR) if there was an error in the DNS response.
* 0 if xExpected set to pdFALSE.
*/
/* TODO cross check again */
uint32_t DNS_ParseDNSReply( uint8_t * pucUDPPayloadBuffer,
size_t uxBufferLength,
struct freertos_addrinfo ** ppxAddressInfo,
Expand Down Expand Up @@ -589,7 +588,7 @@
}

/**
* @brief perform a dns lookup in the local cache {TODO WRONG}
* @brief Process DNS answer field in a DNS response packet from a DNS server.
* @param[in] pxSet a set of variables that are shared among the helper functions.
* @param[out] ppxAddressInfo a linked list storing the DNS answers.
* @param[out] uxBytesRead total bytes consumed by the function
Expand Down Expand Up @@ -658,7 +657,7 @@
}
else if( pxSet->usType == ( uint16_t ) dnsTYPE_A_HOST )
{
pxSet->uxAddressLength = ipSIZE_OF_IPv4_ADDRESS; /*TODO check if fine */
pxSet->uxAddressLength = ipSIZE_OF_IPv4_ADDRESS;

if( pxSet->uxSourceBytesRemaining >= ( sizeof( DNSAnswerRecord_t ) + pxSet->uxAddressLength ) )
{
Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_IP.c
Expand Up @@ -1983,7 +1983,7 @@ static eFrameProcessingResult_t prvProcessIPPacket( const IPPacket_t * pxIPPacke
}
}

if( eReturn != eWaitingARPResolution ) /*TODO eReturn != eReleaseBuffer */
if( eReturn != eWaitingARPResolution )
{
switch( ucProtocol )
{
Expand Down
2 changes: 0 additions & 2 deletions source/FreeRTOS_Sockets.c
Expand Up @@ -1834,7 +1834,6 @@ static BaseType_t prvSocketBindAdd( FreeRTOS_Socket_t * pxSocket,
if( pxSocket->pxEndPoint != NULL )
{
pxSocket->xLocalAddress.ulIP_IPv4 = FreeRTOS_ntohl( pxSocket->pxEndPoint->ipv4_settings.ulIPAddress );
/*TODO Check if needed for ipv6 setting */
}
else
#endif /* ( ipconfigUSE_IPv4 != 0 ) */
Expand Down Expand Up @@ -4940,7 +4939,6 @@ void vSocketWakeUpUser( FreeRTOS_Socket_t * pxSocket )
/* coverity[misra_c_2012_rule_11_3_violation] */
const ListItem_t * pxEnd = ( ( const ListItem_t * ) &( xBoundTCPSocketsList.xListEnd ) );

/* __XX__ TODO ulLocalIP is not used, for misra compliance*/
( void ) ulLocalIP;

for( pxIterator = listGET_NEXT( pxEnd );
Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_TCP_WIN.c
Expand Up @@ -1085,7 +1085,7 @@
/* See if there is more data in a contiguous block to make the
* SACK describe a longer range of data. */

/* TODO: SACK's may also be delayed for a short period
/* SACK's may also be delayed for a short period
* This is useful because subsequent packets will be SACK'd with
* single one message
*/
Expand Down
5 changes: 1 addition & 4 deletions source/include/FreeRTOS_IP.h
Expand Up @@ -485,11 +485,8 @@ extern NetworkBufferDescriptor_t * pxARPWaitingNetworkBuffer;
#define vPrintResourceStats() do {} while( ipFALSE_BOOL ) /**< ipconfigHAS_PRINTF is not defined. Define vPrintResourceStats to a do-while( 0 ). */
#endif

#include "FreeRTOS_IP_Utils.h" /*TODO can be moved after other 2 includes */


#include "FreeRTOS_IP_Utils.h"
#include "FreeRTOS_IPv4.h"

#include "FreeRTOS_IPv6.h"

/* *INDENT-OFF* */
Expand Down
1 change: 0 additions & 1 deletion source/include/FreeRTOS_IPv4.h
Expand Up @@ -60,7 +60,6 @@ struct xIP_PACKET;

/*
* These functions come from the IPv4-only library.
* TODO : They should get an extra parameter, the end-point
* void FreeRTOS_SetIPAddress( uint32_t ulIPAddress );
* void FreeRTOS_SetNetmask( uint32_t ulNetmask );
* void FreeRTOS_SetGatewayAddress( uint32_t ulGatewayAddress );
Expand Down
2 changes: 1 addition & 1 deletion source/portable/CMakeLists.txt
Expand Up @@ -3,7 +3,7 @@ add_library( freertos_plus_tcp_port STATIC )
target_sources( freertos_plus_tcp_port
PRIVATE
BufferManagement/BufferAllocation_${FREERTOS_PLUS_TCP_BUFFER_ALLOCATION}.c
# TODO: There's NetworkInterface/pic32mzef that has it's own BufferAllocation_2.c
# Note: There's NetworkInterface/pic32mzef that has it's own BufferAllocation_2.c
)

target_include_directories( freertos_plus_tcp_port
Expand Down
2 changes: 1 addition & 1 deletion source/portable/NetworkInterface/LPC17xx/CMakeLists.txt
Expand Up @@ -15,7 +15,7 @@ target_sources( freertos_plus_tcp_network_if

target_link_libraries(freertos_plus_tcp_network_if
PRIVATE
lpc17xx_driver # TODO
lpc17xx_driver
)

target_link_libraries( freertos_plus_tcp_network_if
Expand Down
2 changes: 1 addition & 1 deletion source/portable/NetworkInterface/LPC18xx/CMakeLists.txt
Expand Up @@ -15,7 +15,7 @@ target_sources( freertos_plus_tcp_network_if

target_link_libraries(freertos_plus_tcp_network_if
PRIVATE
lpc18xx_driver # TODO
lpc18xx_driver
)

target_link_libraries( freertos_plus_tcp_network_if
Expand Down
2 changes: 1 addition & 1 deletion source/portable/NetworkInterface/LPC54018/CMakeLists.txt
Expand Up @@ -15,7 +15,7 @@ target_sources( freertos_plus_tcp_network_if

target_link_libraries(freertos_plus_tcp_network_if
PRIVATE
lpc54018_driver # TODO
lpc54018_driver
)

target_link_libraries( freertos_plus_tcp_network_if
Expand Down
Expand Up @@ -325,7 +325,7 @@ BaseType_t xNetworkInterfaceInitialise( void )

/* Create the handler. */
ENET_CreateHandler( ENET, &g_handle, &config, &buffConfig[ 0 ], ENET_IntCallback, NULL );
NVIC_SetPriority( 65 - 16, 4 ); /* TODO this is a hack and I would expect a nice ENET API for priority. */
NVIC_SetPriority( 65 - 16, 4 ); /* This is a workaround and using a more robust ENET API for priority setting would be preferable . */

/* Active TX/RX. */
ENET_StartRxTx( ENET, 1, 1 );
Expand Down
1 change: 0 additions & 1 deletion source/portable/NetworkInterface/RX/CMakeLists.txt
Expand Up @@ -5,7 +5,6 @@ endif()
#------------------------------------------------------------------------------
add_library( freertos_plus_tcp_network_if STATIC )

# TODO What about BufferAllocation_2.c here?
target_sources( freertos_plus_tcp_network_if
PRIVATE
ether_callback.c
Expand Down
4 changes: 2 additions & 2 deletions source/portable/NetworkInterface/RX/NetworkInterface.c
Expand Up @@ -518,7 +518,7 @@ static int InitializeNetwork( void )
* Return Value : 0 success, negative fail
**********************************************************************************************************************/
static int16_t SendData( uint8_t * pucBuffer,
size_t length ) /*TODO complete stub function */
size_t length )
{
ether_return_t ret;
uint8_t * pwrite_buffer;
Expand Down Expand Up @@ -581,7 +581,7 @@ void EINT_Trig_isr( void * ectrl )
* priority task. The macro used for this purpose is dependent on the port in
* use and may be called portEND_SWITCHING_ISR(). */
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
/*TODO complete interrupt handler for other events. */
/* Complete interrupt handler for other events. */
}
} /* End of function EINT_Trig_isr() */

Expand Down
2 changes: 1 addition & 1 deletion source/portable/NetworkInterface/SH2A/CMakeLists.txt
Expand Up @@ -12,7 +12,7 @@ target_sources( freertos_plus_tcp_network_if

# target_link_libraries( freertos_plus_tcp_network_if
# PRIVATE
# hwEthernetLib # Todo where is hwEthernet.h?
# hwEthernetLib # Where is hwEthernet.h?
# )

target_link_libraries( freertos_plus_tcp_network_if
Expand Down
2 changes: 1 addition & 1 deletion source/portable/NetworkInterface/STM32Fxx/CMakeLists.txt
Expand Up @@ -10,7 +10,7 @@ target_sources( freertos_plus_tcp_network_if
NetworkInterface.c
# stm32f2xx_hal_eth.h
# stm32f4xx_hal_eth.h
stm32f7xx_hal_eth.h #TODO: Only one of these ?
stm32f7xx_hal_eth.h # Only one of these ?
stm32fxx_hal_eth.c
stm32fxx_hal_eth.h
)
Expand Down
2 changes: 1 addition & 1 deletion source/portable/NetworkInterface/esp32/CMakeLists.txt
Expand Up @@ -15,7 +15,7 @@ target_sources( freertos_plus_tcp_network_if

target_link_libraries( freertos_plus_tcp_network_if
PRIVATE
esp32_lib # TODO
esp32_lib
)

target_link_libraries( freertos_plus_tcp_network_if
Expand Down
2 changes: 1 addition & 1 deletion source/portable/NetworkInterface/libslirp/CMakeLists.txt
Expand Up @@ -16,7 +16,7 @@ target_sources( freertos_plus_tcp_network_if

target_link_libraries(freertos_plus_tcp_network_if
PRIVATE
slirp # TODO
slirp
)

target_link_libraries( freertos_plus_tcp_network_if
Expand Down
2 changes: 1 addition & 1 deletion source/portable/NetworkInterface/pic32mzef/CMakeLists.txt
Expand Up @@ -6,7 +6,7 @@ endif()
#------------------------------------------------------------------------------
add_library( freertos_plus_tcp_network_if STATIC )

# TODO What about BufferAllocation_2.c here?
# What about BufferAllocation_2.c here?
target_sources( freertos_plus_tcp_network_if
PRIVATE
$<$<STREQUAL:${FREERTOS_PLUS_TCP_NETWORK_IF},PIC32MZEF_ETH>:NetworkInterface_eth.c>
Expand Down
21 changes: 1 addition & 20 deletions test/cbmc/stubs/freertos_api.c
Expand Up @@ -135,30 +135,11 @@ int32_t FreeRTOS_recvfrom( Socket_t xSocket,
__CPROVER_assert( pvBuffer != NULL,
"FreeRTOS precondition: pvBuffer != NULL" );

/****************************************************************
* TODO: We need to check this out.
*
* The code calls recvfrom with these parameters NULL, it is not
* clear from the documentation that this is allowed.
****************************************************************/
#if 0
__CPROVER_assert( pxSourceAddress != NULL,
"FreeRTOS precondition: pxSourceAddress != NULL" );
__CPROVER_assert( pxSourceAddressLength != NULL,
"FreeRTOS precondition: pxSourceAddress != NULL" );
#endif

size_t payload_size;
__CPROVER_assume( payload_size + sizeof( UDPPacket_t )
< CBMC_MAX_OBJECT_SIZE );

/****************************************************************
* TODO: We need to make this lower bound explicit in the Makefile.json
*
* DNSMessage_t is a typedef in FreeRTOS_DNS.c
* sizeof(DNSMessage_t) = 6 * sizeof(uint16_t)
****************************************************************/
__CPROVER_assume( payload_size >= 6 * sizeof( uint16_t ) );
__CPROVER_assume( payload_size >= sizeof( DNSMessage_t ) );

#ifdef CBMC_FREERTOS_RECVFROM_BUFFER_BOUND
__CPROVER_assume( payload_size <= CBMC_FREERTOS_RECVFROM_BUFFER_BOUND );
Expand Down
3 changes: 0 additions & 3 deletions test/unit-test/FreeRTOS_ARP/FreeRTOS_ARP_utest.c
Expand Up @@ -2173,9 +2173,6 @@ void test_eARPGetCacheEntry_IPMatchesOtherBroadcastAddr( void )
/* =================================================== */
}

/* TODO: _TJ_: For the time being test_eARPGetCacheEntry_LocalIPIsZero and test_eARPGetCacheEntry_LocalIPMatchesReceivedIP */
/* test cases are removed as we need to reevaluate if those cases are required for IPv6 */

void test_eARPGetCacheEntry_MatchingInvalidEntry( void )
{
uint32_t ulIPAddress;
Expand Down
2 changes: 1 addition & 1 deletion tools/CMakeLists.txt
Expand Up @@ -17,7 +17,7 @@ target_include_directories( freertos_plus_tcp_utilities SYSTEM
tcp_utilities/include
)

#TODO(phelter): Investigate and fix in freertos_plus_tcp if not already fixed.
# Investigate and fix in freertos_plus_tcp if not already fixed.
target_compile_options( freertos_plus_tcp_utilities
PRIVATE
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-extra-semi-stmt>
Expand Down

0 comments on commit bffa66f

Please sign in to comment.