Skip to content
Snippets Groups Projects
Commit e6e556c1 authored by Anatolij Gustschin's avatar Anatolij Gustschin Committed by Wolfgang Denk
Browse files

drivers/net/mvgbe.c: Fix GCC 4.6 warnings


Fix:
mvgbe.c: In function 'mvgbe_send':
mvgbe.c:555:2: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]
mvgbe.c: In function 'mvgbe_recv':
mvgbe.c:640:2: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]

Signed-off-by: default avatarAnatolij Gustschin <agust@denx.de>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-By: default avatarPrafulla Wadaskar <prafulla@marvell.com>
parent 7813ca9b
No related branches found
No related tags found
No related merge requests found
...@@ -531,6 +531,7 @@ static int mvgbe_send(struct eth_device *dev, void *dataptr, ...@@ -531,6 +531,7 @@ static int mvgbe_send(struct eth_device *dev, void *dataptr,
struct mvgbe_txdesc *p_txdesc = dmvgbe->p_txdesc; struct mvgbe_txdesc *p_txdesc = dmvgbe->p_txdesc;
void *p = (void *)dataptr; void *p = (void *)dataptr;
u32 cmd_sts; u32 cmd_sts;
u32 txuq0_reg_addr;
/* Copy buffer if it's misaligned */ /* Copy buffer if it's misaligned */
if ((u32) dataptr & 0x07) { if ((u32) dataptr & 0x07) {
...@@ -552,7 +553,8 @@ static int mvgbe_send(struct eth_device *dev, void *dataptr, ...@@ -552,7 +553,8 @@ static int mvgbe_send(struct eth_device *dev, void *dataptr,
p_txdesc->byte_cnt = datasize; p_txdesc->byte_cnt = datasize;
/* Set this tc desc as zeroth TXUQ */ /* Set this tc desc as zeroth TXUQ */
MVGBE_REG_WR(regs->tcqdp[TXUQ], (u32) p_txdesc); txuq0_reg_addr = (u32)&regs->tcqdp[TXUQ];
writel((u32) p_txdesc, txuq0_reg_addr);
/* ensure tx desc writes above are performed before we start Tx DMA */ /* ensure tx desc writes above are performed before we start Tx DMA */
isb(); isb();
...@@ -583,6 +585,7 @@ static int mvgbe_recv(struct eth_device *dev) ...@@ -583,6 +585,7 @@ static int mvgbe_recv(struct eth_device *dev)
struct mvgbe_rxdesc *p_rxdesc_curr = dmvgbe->p_rxdesc_curr; struct mvgbe_rxdesc *p_rxdesc_curr = dmvgbe->p_rxdesc_curr;
u32 cmd_sts; u32 cmd_sts;
u32 timeout = 0; u32 timeout = 0;
u32 rxdesc_curr_addr;
/* wait untill rx packet available or timeout */ /* wait untill rx packet available or timeout */
do { do {
...@@ -637,8 +640,8 @@ static int mvgbe_recv(struct eth_device *dev) ...@@ -637,8 +640,8 @@ static int mvgbe_recv(struct eth_device *dev)
p_rxdesc_curr->buf_size = PKTSIZE_ALIGN; p_rxdesc_curr->buf_size = PKTSIZE_ALIGN;
p_rxdesc_curr->byte_cnt = 0; p_rxdesc_curr->byte_cnt = 0;
writel((unsigned)p_rxdesc_curr->nxtdesc_p, rxdesc_curr_addr = (u32)&dmvgbe->p_rxdesc_curr;
(u32) &dmvgbe->p_rxdesc_curr); writel((unsigned)p_rxdesc_curr->nxtdesc_p, rxdesc_curr_addr);
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment