Skip to content

Commit 3899c92

Browse files
ComingToydavem330
authored andcommitted
sun4i-emac.c: remove unnecessary branch
According to the current implementation of emac_rx, every arrived packet will be processed in the while loop. So, there is no remain packet last time. The skb_last field and this branch for dealing with it is unnecessary. Signed-off-by: Conley Lee <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 34ac17e commit 3899c92

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

drivers/net/ethernet/allwinner/sun4i-emac.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ struct emac_board_info {
7676
void __iomem *membase;
7777
u32 msg_enable;
7878
struct net_device *ndev;
79-
struct sk_buff *skb_last;
8079
u16 tx_fifo_stat;
8180

8281
int emacrx_completed_flag;
@@ -499,7 +498,6 @@ static void emac_rx(struct net_device *dev)
499498
struct sk_buff *skb;
500499
u8 *rdptr;
501500
bool good_packet;
502-
static int rxlen_last;
503501
unsigned int reg_val;
504502
u32 rxhdr, rxstatus, rxcount, rxlen;
505503

@@ -514,22 +512,6 @@ static void emac_rx(struct net_device *dev)
514512
if (netif_msg_rx_status(db))
515513
dev_dbg(db->dev, "RXCount: %x\n", rxcount);
516514

517-
if ((db->skb_last != NULL) && (rxlen_last > 0)) {
518-
dev->stats.rx_bytes += rxlen_last;
519-
520-
/* Pass to upper layer */
521-
db->skb_last->protocol = eth_type_trans(db->skb_last,
522-
dev);
523-
netif_rx(db->skb_last);
524-
dev->stats.rx_packets++;
525-
db->skb_last = NULL;
526-
rxlen_last = 0;
527-
528-
reg_val = readl(db->membase + EMAC_RX_CTL_REG);
529-
reg_val &= ~EMAC_RX_CTL_DMA_EN;
530-
writel(reg_val, db->membase + EMAC_RX_CTL_REG);
531-
}
532-
533515
if (!rxcount) {
534516
db->emacrx_completed_flag = 1;
535517
reg_val = readl(db->membase + EMAC_INT_CTL_REG);

0 commit comments

Comments
 (0)