netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel@vger.kernel.org
Cc: davem@davemloft.net, Fabian Frederick <fabf@skynet.be>,
	netdev@vger.kernel.org
Subject: [PATCH 1/4 linux-next] net: fec: use container_of to resolve bufdesc_ex from bufdesc
Date: Sat, 13 Sep 2014 22:38:26 +0200	[thread overview]
Message-ID: <1410640709-18295-2-git-send-email-fabf@skynet.be> (raw)
In-Reply-To: <1410640709-18295-1-git-send-email-fabf@skynet.be>

Use container_of instead of casting first structure member.

ARM cross-compiled but untested.

Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
 drivers/net/ethernet/freescale/fec_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 89355a7..f1a99d2 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -572,7 +572,7 @@ fec_enet_txq_put_data_tso(struct sk_buff *skb, struct net_device *ndev,
 	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;
@@ -631,7 +631,7 @@ fec_enet_txq_put_hdr_tso(struct sk_buff *skb, struct net_device *ndev,
 	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;
-- 
1.8.4.5

  reply	other threads:[~2014-09-13 20:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-13 20:38 [PATCH 0/4 linux-next] drivers/net: use container_of where possible Fabian Frederick
2014-09-13 20:38 ` Fabian Frederick [this message]
2014-09-15 16:49   ` [PATCH 1/4 linux-next] net: fec: use container_of to resolve bufdesc_ex from bufdesc David Miller
2014-09-13 20:38 ` [PATCH 2/4 linux-next] bna: " Fabian Frederick
2014-09-15 16:49   ` David Miller
2014-09-13 20:38 ` [PATCH 3/4 linux-next] brcm80211: use container_of to resolve brcms_phy from brcms_phy_pub Fabian Frederick
2014-09-13 20:38 ` [PATCH 4/4 linux-next] brcm80211: use container_of to resolve dma_info from dma_pub Fabian Frederick
     [not found] ` <1410640709-18295-1-git-send-email-fabf-AgBVmzD5pcezQB+pC5nmwQ@public.gmane.org>
2014-09-14  7:32   ` [PATCH 0/4 linux-next] drivers/net: use container_of where possible Arend van Spriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410640709-18295-2-git-send-email-fabf@skynet.be \
    --to=fabf@skynet.be \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).