summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-09-13 22:38:26 +0200
committerDavid S. Miller <davem@davemloft.net>2014-09-15 12:49:11 -0400
commit61cd2ebb35dcf1990f66af76649260a79ae4cb15 (patch)
tree7c5c288c7fc66c50314306e279911a6c72b54ea3 /drivers
parentc0d1379a19c3dde3c32be50164997d246241c1e4 (diff)
downloadlinux-61cd2ebb35dcf1990f66af76649260a79ae4cb15.tar.bz2
net: fec: use container_of to resolve bufdesc_ex from bufdesc
Use container_of instead of casting first structure member. ARM cross-compiled but untested. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 8f8e55ea7f85..e242eacfc430 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -591,7 +591,7 @@ fec_enet_txq_put_data_tso(struct fec_enet_priv_tx_q *txq, struct sk_buff *skb,
struct fec_enet_private *fep = netdev_priv(ndev);
const struct platform_device_id *id_entry =
platform_get_device_id(fep->pdev);
- struct bufdesc_ex *ebdp = (struct bufdesc_ex *)bdp;
+ struct bufdesc_ex *ebdp = container_of(bdp, struct bufdesc_ex, desc);
unsigned short status;
unsigned int estatus = 0;
dma_addr_t addr;
@@ -651,7 +651,7 @@ fec_enet_txq_put_hdr_tso(struct fec_enet_priv_tx_q *txq,
const struct platform_device_id *id_entry =
platform_get_device_id(fep->pdev);
int hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
- struct bufdesc_ex *ebdp = (struct bufdesc_ex *)bdp;
+ struct bufdesc_ex *ebdp = container_of(bdp, struct bufdesc_ex, desc);
void *bufaddr;
unsigned long dmabuf;
unsigned short status;