Skip to content

Commit 0c232ef

Browse files
Fix MISRA violations (#1159)
1 parent 4c4223a commit 0c232ef

File tree

6 files changed

+11
-4
lines changed

6 files changed

+11
-4
lines changed

source/FreeRTOS_DNS_Parser.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@
330330
#if ( ipconfigUSE_DNS_CACHE == 1 ) || ( ipconfigDNS_USE_CALLBACKS == 1 )
331331
uxResult = DNS_ReadNameField( &xSet,
332332
sizeof( xSet.pcName ) );
333+
( void ) uxResult;
333334
#endif
334335
}
335336
}
@@ -359,6 +360,7 @@
359360
{
360361
uxResult = DNS_ReadNameField( &xSet,
361362
sizeof( xSet.pcName ) );
363+
( void ) uxResult;
362364
}
363365
else
364366
#endif /* ipconfigUSE_DNS_CACHE || ipconfigDNS_USE_CALLBACKS */

source/FreeRTOS_RA.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@
489489
if( pxEndPoint->xRAData.bits.bRouterReplied != pdFALSE_UNSIGNED )
490490
{
491491
/* Obtained configuration from a router. */
492-
uxNewReloadTime = pdMS_TO_TICKS( 1000U * pxEndPoint->xRAData.ulPreferredLifeTime );
492+
uxNewReloadTime = pdMS_TO_TICKS( ( 1000U * ( uint64_t ) pxEndPoint->xRAData.ulPreferredLifeTime ) );
493493
pxEndPoint->xRAData.eRAState = eRAStatePreLease;
494494
iptraceRA_SUCCEEDED( &( pxEndPoint->ipv6_settings.xIPAddress ) );
495495
FreeRTOS_printf( ( "RA: succeeded, using IP address %pip Reload after %u seconds\n",

source/FreeRTOS_Sockets.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2893,6 +2893,8 @@ BaseType_t FreeRTOS_setsockopt( Socket_t xSocket,
28932893
/* The type cast of the pointer expression "A" to
28942894
* type "B" removes const qualifier from the pointed to type. */
28952895

2896+
ipconfigISO_STRICTNESS_VIOLATION_START;
2897+
28962898
/* MISRA Ref 11.8.1 [Function pointer and use of const pointer] */
28972899
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-118 */
28982900

@@ -2901,7 +2903,6 @@ BaseType_t FreeRTOS_setsockopt( Socket_t xSocket,
29012903
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-111 */
29022904
/* coverity[misra_c_2012_rule_11_8_violation] */
29032905
/* coverity[misra_c_2012_rule_11_1_violation] */
2904-
ipconfigISO_STRICTNESS_VIOLATION_START;
29052906
pxSocket->pxUserWakeCallback = ( SocketWakeupCallback_t ) pvOptionValue;
29062907
ipconfigISO_STRICTNESS_VIOLATION_END;
29072908
xReturn = 0;

source/FreeRTOS_TCP_IP.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@
277277
static BaseType_t vTCPRemoveTCPChild( const FreeRTOS_Socket_t * pxChildSocket )
278278
{
279279
BaseType_t xReturn = pdFALSE;
280+
281+
/* MISRA Ref 11.3.1 [Misaligned access] */
282+
/* More details at: https://github.com/FreeRTOS/FreeRTOS-Plus-TCP/blob/main/MISRA.md#rule-113 */
283+
/* coverity[misra_c_2012_rule_11_3_violation] */
280284
const ListItem_t * pxEnd = ( ( const ListItem_t * ) &( xBoundTCPSocketsList.xListEnd ) );
281285

282286
/* MISRA Ref 11.3.1 [Misaligned access] */

source/FreeRTOS_TCP_State_Handling_IPv4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ FreeRTOS_Socket_t * prvHandleListen_IPV4( FreeRTOS_Socket_t * pxSocket,
200200
/* Close the socket if it was newly created. */
201201
if( xIsNewSocket == pdTRUE )
202202
{
203-
vSocketClose( pxReturn );
203+
( void ) vSocketClose( pxReturn );
204204
}
205205

206206
pxReturn = NULL;

source/FreeRTOS_TCP_State_Handling_IPv6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ FreeRTOS_Socket_t * prvHandleListen_IPV6( FreeRTOS_Socket_t * pxSocket,
200200
/* Close the socket if it was newly created. */
201201
if( xIsNewSocket == pdTRUE )
202202
{
203-
vSocketClose( pxReturn );
203+
( void ) vSocketClose( pxReturn );
204204
}
205205

206206
pxReturn = NULL;

0 commit comments

Comments
 (0)