Skip to content

Commit 64e8986

Browse files
author
Holden
committed
minor cleanup
1 parent fea4033 commit 64e8986

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

source/portable/BufferManagement/BufferAllocation.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@
2424
#define STATIC_ASSERT( e ) \
2525
enum { ASSERT_CONCAT( assert_line_, __LINE__ ) = 1 / ( !!( e ) ) }
2626

27-
#define baALIGNMENT_MASK ( portBYTE_ALIGNMENT - 1U )
28-
2927
#if ipconfigIS_ENABLED( ipconfigBUFFER_ALLOC_STATIC )
3028
#define baINTERRUPT_BUFFER_GET_THRESHOLD ( 3 )
3129
#if ipconfigIS_DISABLED( ipconfigBUFFER_ALLOC_STATIC_CUSTOM_SIZE )
3230
uxBufferAllocFixedSize = ipTOTAL_ETHERNET_FRAME_SIZE;
3331
#endif
3432
STATIC_ASSERT( uxBufferAllocFixedSize > 0 );
3533
#define baBUFFER_SIZE ( uxBufferAllocFixedSize + ipBUFFER_PADDING )
36-
#define baBUFFER_SIZE_ALIGNED ( ( baBUFFER_SIZE + portBYTE_ALIGNMENT ) & ~baALIGNMENT_MASK )
34+
#define baBUFFER_SIZE_ALIGNED ( ( baBUFFER_SIZE + portBYTE_ALIGNMENT ) & ~portBYTE_ALIGNMENT_MASK )
3735
#else
3836

3937
/* The obtained network buffer must be large enough to hold a packet that might
@@ -184,9 +182,9 @@ UBaseType_t uxGetNumberOfFreeNetworkBuffers( void )
184182

185183
/* Round up xSize to the nearest multiple of N bytes,
186184
* where N equals 'sizeof( size_t )'. */
187-
if( ( xSize & baALIGNMENT_MASK ) != 0U )
185+
if( ( xSize & portBYTE_ALIGNMENT_MASK ) != 0U )
188186
{
189-
const size_t xBytesRequiredForAlignment = portBYTE_ALIGNMENT - ( xSize & baALIGNMENT_MASK );
187+
const size_t xBytesRequiredForAlignment = portBYTE_ALIGNMENT - ( xSize & portBYTE_ALIGNMENT_MASK );
190188

191189
if( baADD_WILL_OVERFLOW( xSize, xBytesRequiredForAlignment ) == 0 )
192190
{
@@ -421,9 +419,9 @@ NetworkBufferDescriptor_t * pxGetNetworkBufferWithDescriptor( size_t xRequestedS
421419
xIntegerOverflowed = pdTRUE;
422420
}
423421

424-
if( ( xRequestedSizeBytesCopy & baALIGNMENT_MASK ) != 0U )
422+
if( ( xRequestedSizeBytesCopy & portBYTE_ALIGNMENT_MASK ) != 0U )
425423
{
426-
const size_t xBytesRequiredForAlignment = portBYTE_ALIGNMENT - ( xRequestedSizeBytesCopy & baALIGNMENT_MASK );
424+
const size_t xBytesRequiredForAlignment = portBYTE_ALIGNMENT - ( xRequestedSizeBytesCopy & portBYTE_ALIGNMENT_MASK );
427425

428426
if( baADD_WILL_OVERFLOW( xRequestedSizeBytesCopy, xBytesRequiredForAlignment ) == 0 )
429427
{

source/portable/NetworkInterface/DriverSAM/gmac_SAM.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,6 @@
123123
* @{
124124
*/
125125

126-
/*
127-
* When BufferAllocation_1.c is used, the network buffer space
128-
* is declared statically as 'ucNetworkPackets[]'.
129-
* Like the DMA descriptors, this array is located in a non-cached area.
130-
* Here an example of the total size:
131-
*
132-
* #define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 24
133-
* #define GMAC_FRAME_LENTGH_MAX 1536
134-
* Hidden space for back-pointer and IP-type 16
135-
*
136-
* Total size: 24 * ( 1536 + 16 ) = 37248 bytes
137-
*/
138-
__attribute__( ( aligned( 32 ) ) )
139-
__attribute__( ( section( ".first_data" ) ) )
140-
uint8_t ucNetworkPackets[ ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS * NETWORK_BUFFER_SIZE ];
141-
142126
/** TX descriptor lists */
143127
__attribute__( ( section( ".first_data" ) ) )
144128
COMPILER_ALIGNED( 8 )

0 commit comments

Comments
 (0)