Skip to contentSkip to conversation

sgi-xp: Kill directly reference of netdev->priv

PATCH In review Wang Chen 3 participants 3 messages Dec 4, 2008

Subsystems (3)
lore
Share & tools
lore

Wang Chen

author
#0 lore raw

PATCH 1/1 sgi-xp: Kill directly reference of netdev->priv

Simply replace netdev->priv with netdev_priv().

Not do compile test, because no IA64 or x86_64 box.

---
 drivers/misc/sgi-xp/xpnet.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/misc/sgi-xp/xpnet.c +5 -4
index 71513b3..9e5233a 100644
@@ -154,7 +154,7 @@ xpnet_receive(short partid, int channel, struct xpnet_message *msg)
 	void *dst;
 	enum xp_retval ret;
 	struct xpnet_dev_private *priv =
-	    (struct xpnet_dev_private *)xpnet_device->priv;
+	    (struct xpnet_dev_private *)netdev_priv(xpnet_device);
 
 	if (!XPNET_VALID_MSG(msg)) {
 		/*
@@ -370,7 +370,7 @@ xpnet_dev_get_stats(struct net_device *dev)
 {
 	struct xpnet_dev_private *priv;
 
-	priv = (struct xpnet_dev_private *)dev->priv;
+	priv = (struct xpnet_dev_private *)netdev_priv(dev);
 
 	return &priv->stats;
 }
@@ -456,7 +456,8 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
 	struct xpnet_pending_msg *queued_msg;
 	u64 start_addr, end_addr;
 	short dest_partid;
-	struct xpnet_dev_private *priv = (struct xpnet_dev_private *)dev->priv;
+	struct xpnet_dev_private *priv =
+		(struct xpnet_dev_private *)netdev_priv(dev);
 	u16 embedded_bytes = 0;
 
 	dev_dbg(xpnet, ">skb->head=0x%p skb->data=0x%p skb->tail=0x%p "
@@ -543,7 +544,7 @@ xpnet_dev_tx_timeout(struct net_device *dev)
 {
 	struct xpnet_dev_private *priv;
 
-	priv = (struct xpnet_dev_private *)dev->priv;
+	priv = (struct xpnet_dev_private *)netdev_priv(dev);
 
 	priv->stats.tx_errors++;
 	return;
Signature · 1 line
1.5.3.4
#1 lore raw
Quoted 14 lines · Wang Chen

Simply replace netdev->priv with netdev_priv().

Not do compile test, because no IA64 or x86_64 box.

---
 drivers/misc/sgi-xp/xpnet.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
drivers/misc/sgi-xp/xpnet.c +0 -0
index 71513b3..9e5233a 100644

drivers/misc/sgi-xp/xpnet.c xpnet_receive(short partid, int channel, struct xpnet_message *msg) · line 157

Quoted 5 lines
drivers/misc/sgi-xp/xpnet.c +1 -1
@@ -154,7 +154,7 @@ xpnet_receive(short partid, int channel, struct xpnet_message *msg)
 	void *dst;
 	enum xp_retval ret;
 	struct xpnet_dev_private *priv =
-	    (struct xpnet_dev_private *)xpnet_device->priv;
+	    (struct xpnet_dev_private *)netdev_priv(xpnet_device);

netdev_priv returns void, so these casts seem unnecessary here & other places belwo (which I cut)...

Signature · 1 line
 i.
maintainer
#2 lore raw

From: "Ilpo Järvinen" <[email protected]>
Date: Thu, 4 Dec 2008 15:41:15 +0200 (EET)

Quoted 11 lines · Wang Chen
Quoted 10 lines

Simply replace netdev->priv with netdev_priv().

Not do compile test, because no IA64 or x86_64 box.

---
 drivers/misc/sgi-xp/xpnet.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
Quoted 13 lines

drivers/misc/sgi-xp/xpnet.c xpnet_receive(short partid, int channel, struct xpnet_message *msg) · line 157

Quoted 10 lines
drivers/misc/sgi-xp/xpnet.c +1 -1
index 71513b3..9e5233a 100644
@@ -154,7 +154,7 @@ xpnet_receive(short partid, int channel, struct xpnet_message *msg)
 	void *dst;
 	enum xp_retval ret;
 	struct xpnet_dev_private *priv =
-	    (struct xpnet_dev_private *)xpnet_device->priv;
+	    (struct xpnet_dev_private *)netdev_priv(xpnet_device);

netdev_priv returns void, so these casts seem unnecessary here & other places belwo (which I cut)...

I took care of fixing this up when applying Wang's patch.

Thanks.