Skip to content

Commit b506a3a

Browse files
committed
remove unnecessary define
1 parent 2fcdb0c commit b506a3a

File tree

1 file changed

+11
-28
lines changed

1 file changed

+11
-28
lines changed

bsp/raspberry-pi/raspi4-32/driver/drv_eth.c

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@
2424
#define RECV_DATA_NO_CACHE (0x08400000)
2525
#define DMA_DISC_ADDR_SIZE (4 * 1024 *1024)
2626

27-
#define RX_DESC_BASE (MAC_REG + GENET_RX_OFF)
28-
#define TX_DESC_BASE (MAC_REG + GENET_TX_OFF)
27+
#define RX_DESC_BASE (MAC_REG + GENET_RX_OFF)
28+
#define TX_DESC_BASE (MAC_REG + GENET_TX_OFF)
2929

30-
#define MAX_ADDR_LEN (6)
30+
#define MAX_ADDR_LEN (6)
31+
32+
#define upper_32_bits(n) ((rt_uint32_t)(((n) >> 16) >> 16))
33+
#define lower_32_bits(n) ((rt_uint32_t)(n))
34+
35+
#define BIT(nr) (1UL << (nr))
3136

3237
static rt_uint32_t tx_index = 0;
3338
static rt_uint32_t rx_index = 0;
@@ -50,28 +55,6 @@ struct rt_eth_dev
5055
static struct rt_eth_dev eth_dev;
5156
static struct rt_semaphore sem_lock;
5257

53-
#define upper_32_bits(n) ((rt_uint32_t)(((n) >> 16) >> 16))
54-
#define lower_32_bits(n) ((rt_uint32_t)(n))
55-
56-
57-
#define BIT(nr) (1UL << (nr))
58-
59-
#define roundup(x, y) ( \
60-
{ \
61-
const typeof(y) __y = y; \
62-
(((x) + (__y - 1)) / __y) * __y; \
63-
} \
64-
)
65-
#define rounddown(x, y) ( \
66-
{ \
67-
typeof(x) __x = (x); \
68-
__x - (__x % (y)); \
69-
} \
70-
)
71-
72-
#define CLR(r,x) (r &= ~(1UL << x))
73-
#define SET(r,y) (r |= (1UL << y))
74-
7558
static inline rt_uint32_t read32(void *addr)
7659
{
7760
return (*((volatile unsigned int*)(addr)));
@@ -214,7 +197,7 @@ static int bcmgenet_gmac_write_hwaddr(void)
214197
return 0;
215198
}
216199

217-
int get_ethernet_uid(void)
200+
static int get_ethernet_uid(void)
218201
{
219202
rt_uint32_t uid_high = 0;
220203
rt_uint32_t uid_low = 0;
@@ -308,7 +291,7 @@ static void rx_descs_init(void)
308291
}
309292
}
310293

311-
int phy_startup(void)
294+
static int phy_startup(void)
312295
{
313296
int count = 1000000;
314297
while ((bcmgenet_mdio_read(1, BCM54213PE_MII_STATUS) & MII_STATUS_LINK_UP) && (--count))
@@ -344,7 +327,7 @@ int phy_startup(void)
344327
return 0;
345328
}
346329

347-
int bcmgenet_adjust_link(void)
330+
static int bcmgenet_adjust_link(void)
348331
{
349332
rt_uint32_t speed;
350333
rt_uint32_t phy_dev_speed = SPEED_100;

0 commit comments

Comments
 (0)