From 7e7801e54ee1429d7ec4c87fd12633f86b100f9f Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 23 Mar 2014 15:17:13 +0000 Subject: net: fec: use a union for the buffer descriptors Using a union gives clearer C code than the existing solution, and allows the removal of some odd code from the receive path whose purpose was to merely store the enhanced buffer descriptor. Signed-off-by: Russell King --- drivers/net/ethernet/freescale/fec.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'drivers/net/ethernet/freescale/fec.h') diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index a1caee8fd648..e850e7e5118f 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h @@ -170,6 +170,11 @@ struct bufdesc_ex { unsigned short res0[4]; }; +union bufdesc_u { + struct bufdesc bd; + struct bufdesc_ex ebd; +}; + /* * The following definitions courtesy of commproc.h, which where * Copyright (c) 1997 Dan Malek (dmalek@jlc.net). @@ -288,14 +293,13 @@ struct fec_enet_private { dma_addr_t rx_bd_dma; dma_addr_t tx_bd_dma; /* Address of Rx and Tx buffers */ - struct bufdesc *rx_bd_base; - struct bufdesc *tx_bd_base; + union bufdesc_u *rx_bd_base; + union bufdesc_u *tx_bd_base; /* The next free ring entry */ - struct bufdesc *cur_rx, *cur_tx; + union bufdesc_u *cur_rx, *cur_tx; /* The ring entries to be free()ed */ - struct bufdesc *dirty_tx; + union bufdesc_u *dirty_tx; - unsigned short bufdesc_size; unsigned short tx_ring_size; unsigned short rx_ring_size; unsigned short tx_stop_threshold; -- cgit