Skip to content

Commit 6c51beb

Browse files
Remove unused variable and add compound block
1 parent 9842ae6 commit 6c51beb

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

FreeRTOS_ARP.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ BaseType_t xCheckRequiresARPResolution( NetworkBufferDescriptor_t * pxNetworkBuf
462462
void vARPRefreshCacheEntryAge( const MACAddress_t * pxMACAddress,
463463
const uint32_t ulIPAddress )
464464
{
465-
BaseType_t x, xMatchingMAC;
465+
BaseType_t x;
466466

467467
if( pxMACAddress != NULL )
468468
{

FreeRTOS_TCP_IP.c

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,25 +1038,27 @@
10381038
}
10391039
#endif
10401040

1041-
MACAddress_t xMACAddress;
1042-
uint32_t ulDestinationIPAddress = pxIPHeader->ulDestinationIPAddress;
1043-
eARPLookupResult_t eResult;
1041+
{
1042+
MACAddress_t xMACAddress;
1043+
uint32_t ulDestinationIPAddress = pxIPHeader->ulDestinationIPAddress;
1044+
eARPLookupResult_t eResult;
10441045

1045-
eResult = eARPGetCacheEntry( &ulDestinationIPAddress, &xMACAddress );
1046+
eResult = eARPGetCacheEntry( &ulDestinationIPAddress, &xMACAddress );
10461047

1047-
if( eResult == eARPCacheHit )
1048-
{
1049-
pvCopySource = &xMACAddress;
1050-
}
1051-
else
1052-
{
1053-
pvCopySource = &pxEthernetHeader->xSourceAddress;
1054-
}
1048+
if( eResult == eARPCacheHit )
1049+
{
1050+
pvCopySource = &xMACAddress;
1051+
}
1052+
else
1053+
{
1054+
pvCopySource = &pxEthernetHeader->xSourceAddress;
1055+
}
10551056

1056-
/* Fill in the destination MAC addresses. */
1057-
( void ) memcpy( ( void * ) ( &( pxEthernetHeader->xDestinationAddress ) ),
1058-
pvCopySource,
1059-
sizeof( pxEthernetHeader->xDestinationAddress ) );
1057+
/* Fill in the destination MAC addresses. */
1058+
( void ) memcpy( ( void * ) ( &( pxEthernetHeader->xDestinationAddress ) ),
1059+
pvCopySource,
1060+
sizeof( pxEthernetHeader->xDestinationAddress ) );
1061+
}
10601062

10611063
/*
10621064
* Use helper variables for memcpy() to remain

0 commit comments

Comments
 (0)