Skip to content

Commit

Permalink
Fix MISRA violations
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-josi-aws committed Jun 18, 2024
1 parent 4c4223a commit e65ff1e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions source/FreeRTOS_DNS_Parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@
#if ( ipconfigUSE_DNS_CACHE == 1 ) || ( ipconfigDNS_USE_CALLBACKS == 1 )
uxResult = DNS_ReadNameField( &xSet,
sizeof( xSet.pcName ) );
( void ) uxResult;
#endif
}
}
Expand Down Expand Up @@ -359,6 +360,7 @@
{
uxResult = DNS_ReadNameField( &xSet,
sizeof( xSet.pcName ) );
( void ) uxResult;
}
else
#endif /* ipconfigUSE_DNS_CACHE || ipconfigDNS_USE_CALLBACKS */
Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_RA.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@
if( pxEndPoint->xRAData.bits.bRouterReplied != pdFALSE_UNSIGNED )
{
/* Obtained configuration from a router. */
uxNewReloadTime = pdMS_TO_TICKS( 1000U * pxEndPoint->xRAData.ulPreferredLifeTime );
uxNewReloadTime = pdMS_TO_TICKS( ( 1000U * ( uint64_t ) pxEndPoint->xRAData.ulPreferredLifeTime ) );
pxEndPoint->xRAData.eRAState = eRAStatePreLease;
iptraceRA_SUCCEEDED( &( pxEndPoint->ipv6_settings.xIPAddress ) );
FreeRTOS_printf( ( "RA: succeeded, using IP address %pip Reload after %u seconds\n",
Expand Down
3 changes: 2 additions & 1 deletion source/FreeRTOS_Sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -2893,6 +2893,8 @@ BaseType_t FreeRTOS_setsockopt( Socket_t xSocket,
/* The type cast of the pointer expression "A" to
* type "B" removes const qualifier from the pointed to type. */

ipconfigISO_STRICTNESS_VIOLATION_START;

/* MISRA Ref 11.8.1 [Function pointer and use of const pointer] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-118 */

Expand All @@ -2901,7 +2903,6 @@ BaseType_t FreeRTOS_setsockopt( Socket_t xSocket,
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-111 */
/* coverity[misra_c_2012_rule_11_8_violation] */
/* coverity[misra_c_2012_rule_11_1_violation] */
ipconfigISO_STRICTNESS_VIOLATION_START;
pxSocket->pxUserWakeCallback = ( SocketWakeupCallback_t ) pvOptionValue;
ipconfigISO_STRICTNESS_VIOLATION_END;
xReturn = 0;
Expand Down
4 changes: 4 additions & 0 deletions source/FreeRTOS_TCP_IP.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@
static BaseType_t vTCPRemoveTCPChild( const FreeRTOS_Socket_t * pxChildSocket )
{
BaseType_t xReturn = pdFALSE;

/* MISRA Ref 11.3.1 [Misaligned access] */
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-113 */
/* coverity[misra_c_2012_rule_11_3_violation] */
const ListItem_t * pxEnd = ( ( const ListItem_t * ) &( xBoundTCPSocketsList.xListEnd ) );

/* MISRA Ref 11.3.1 [Misaligned access] */
Expand Down
2 changes: 1 addition & 1 deletion source/FreeRTOS_TCP_State_Handling_IPv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ FreeRTOS_Socket_t * prvHandleListen_IPV6( FreeRTOS_Socket_t * pxSocket,
/* Close the socket if it was newly created. */
if( xIsNewSocket == pdTRUE )
{
vSocketClose( pxReturn );
( void ) vSocketClose( pxReturn );
}

pxReturn = NULL;
Expand Down

0 comments on commit e65ff1e

Please sign in to comment.