netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: Kill directly reference of netdev->priv
@ 2008-12-08 14:53 Jianjun Kong
  2008-12-08 20:27 ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Jianjun Kong @ 2008-12-08 14:53 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev


Replace netdev->priv with netdev_priv() like
4bcd42679643dd3dfd6aaad9fcbcc74ac5c7e2e9

Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
---
 drivers/net/igb/igb_ethtool.c     |    4 ++--
 drivers/net/ixgbe/ixgbe_ethtool.c |    4 ++--
 net/atm/mpc.c                     |   10 +++++-----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 89964fa..34382cf 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -101,8 +101,8 @@ static const struct igb_stats igb_gstrings_stats[] = {
 };
 
 #define IGB_QUEUE_STATS_LEN \
-	((((struct igb_adapter *)netdev->priv)->num_rx_queues + \
-	 ((struct igb_adapter *)netdev->priv)->num_tx_queues) * \
+	(((netdev_priv(netdev))->num_rx_queues + \
+	 (netdev_priv(netdev))->num_tx_queues) * \
 	(sizeof(struct igb_queue_stats) / sizeof(u64)))
 #define IGB_GLOBAL_STATS_LEN	\
 	sizeof(igb_gstrings_stats) / sizeof(struct igb_stats)
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 81a9c4b..74d4aeb 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -94,8 +94,8 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = {
 };
 
 #define IXGBE_QUEUE_STATS_LEN \
-                ((((struct ixgbe_adapter *)netdev->priv)->num_tx_queues + \
-                 ((struct ixgbe_adapter *)netdev->priv)->num_rx_queues) * \
+                (((netdev_priv(netdev))->num_tx_queues + \
+                 (netdev_priv(netdev))->num_rx_queues) * \
                  (sizeof(struct ixgbe_queue_stats) / sizeof(u64)))
 #define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + IXGBE_QUEUE_STATS_LEN)
 #define IXGBE_GLOBAL_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_stats)
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 11b16d1..236f416 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -785,7 +785,7 @@ static int atm_mpoa_mpoad_attach (struct atm_vcc *vcc, int arg)
 	}
 
 	if (mpc->dev) { /* check if the lec is LANE2 capable */
-		priv = (struct lec_priv *)mpc->dev->priv;
+		priv = netdev_priv(mpc->dev);
 		if (priv->lane_version < 2) {
 			dev_put(mpc->dev);
 			mpc->dev = NULL;
@@ -845,7 +845,7 @@ static void mpoad_close(struct atm_vcc *vcc)
 
 	mpc->mpoad_vcc = NULL;
 	if (mpc->dev) {
-		struct lec_priv *priv = (struct lec_priv *)mpc->dev->priv;
+		struct lec_priv *priv = netdev_priv(mpc->dev);
 		priv->lane2_ops->associate_indicator = NULL;
 		stop_mpc(mpc);
 		dev_put(mpc->dev);
@@ -976,7 +976,7 @@ static int mpoa_event_listener(struct notifier_block *mpoa_notifier, unsigned lo
 
 	switch (event) {
 	case NETDEV_REGISTER:       /* a new lec device was allocated */
-		priv = (struct lec_priv *)dev->priv;
+		priv = netdev_priv(dev);
 		if (priv->lane_version < 2)
 			break;
 		priv->lane2_ops->associate_indicator = lane2_assoc_ind;
@@ -1322,7 +1322,7 @@ static void set_mpc_ctrl_addr_rcvd(struct k_message *mesg, struct mpoa_client *m
 	dprintk("\n");
 
 	if (mpc->dev) {
-		priv = (struct lec_priv *)mpc->dev->priv;
+		priv = netdev_priv(mpc->dev);
 		retval = priv->lane2_ops->associate_req(mpc->dev, mpc->dev->dev_addr, tlv, sizeof(tlv));
 		if (retval == 0)
 			printk("mpoa: (%s) MPOA device type TLV association failed\n", mpc->dev->name);
@@ -1472,7 +1472,7 @@ static void __exit atm_mpoa_cleanup(void)
 		tmp = mpc->next;
 		if (mpc->dev != NULL) {
 			stop_mpc(mpc);
-			priv = (struct lec_priv *)mpc->dev->priv;
+			priv = netdev_priv(mpc->dev);
 			if (priv->lane2_ops != NULL)
 				priv->lane2_ops->associate_indicator = NULL;
 		}
-- 
1.5.6.3

-- 
Jianjun Kong |Happy Hacking
Homepage: http://kongove.cn
Gtalk:kongjianjun@gmail.com

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: Kill directly reference of netdev->priv
  2008-12-08 14:53 [PATCH] net: Kill directly reference of netdev->priv Jianjun Kong
@ 2008-12-08 20:27 ` David Miller
  2008-12-09  1:32   ` Jianjun Kong
  0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2008-12-08 20:27 UTC (permalink / raw)
  To: jianjun; +Cc: netdev


Jianjun, please...

In the net-next-2.6 tree every single netdev_priv() conversion
has been done already.  netdev->priv doesn't even exist any
more, so you are duplicating a lot of work needlessly.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] net: Kill directly reference of netdev->priv
  2008-12-08 20:27 ` David Miller
@ 2008-12-09  1:32   ` Jianjun Kong
  2008-12-09  2:53     ` Wei Yongjun
  2008-12-09  7:34     ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Jianjun Kong @ 2008-12-09  1:32 UTC (permalink / raw)
  To: David Miller; +Cc: netdev


another new patch for net-next-2.6
---

>From fbd6be20695810f32aa58a5cd889f959d87a019f Mon Sep 17 00:00:00 2001
From: Jianjun Kong <jianjun@zeuux.org>
Date: Tue, 9 Dec 2008 09:23:54 +0800
Subject: [PATCH] net: Kill directly reference of netdev->priv

drivers/net/wireless/ray_cs.c:
Replace "(struct net_device *)link->priv" with "netdev_priv((struct net_device *)link)"

Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
---
 drivers/net/wireless/ray_cs.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 81b71f0..828aa47 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -412,7 +412,7 @@ static int ray_config(struct pcmcia_device *link)
     int i;
     win_req_t req;
     memreq_t mem;
-    struct net_device *dev = (struct net_device *)link->priv;
+    struct net_device *dev = netdev_priv((struct net_device *)link);
     ray_dev_t *local = netdev_priv(dev);
 
     DEBUG(1, "ray_config(0x%p)\n", link);
@@ -784,7 +784,7 @@ static void join_net(u_long data)
 =============================================================================*/
 static void ray_release(struct pcmcia_device *link)
 {
-    struct net_device *dev = link->priv; 
+    struct net_device *dev = netdev_priv((struct net_device *)link);
     ray_dev_t *local = netdev_priv(dev);
     int i;
     
@@ -807,7 +807,7 @@ static void ray_release(struct pcmcia_device *link)
 
 static int ray_suspend(struct pcmcia_device *link)
 {
-	struct net_device *dev = link->priv;
+	struct net_device *dev = netdev_priv((struct net_device *)link);
 
 	if (link->open)
 		netif_device_detach(dev);
@@ -817,7 +817,7 @@ static int ray_suspend(struct pcmcia_device *link)
 
 static int ray_resume(struct pcmcia_device *link)
 {
-	struct net_device *dev = link->priv;
+	struct net_device *dev = netdev_priv((struct net_device *)link);
 
 	if (link->open) {
 		ray_reset(dev);
@@ -2505,7 +2505,7 @@ static void associate(ray_dev_t *local)
 {
     struct ccs __iomem *pccs;
     struct pcmcia_device *link = local->finder;
-    struct net_device *dev = link->priv;
+    struct net_device *dev = netdev_priv((struct net_device *)link);
     int ccsindex;
     if (!(pcmcia_dev_present(link))) {
         DEBUG(2,"ray_cs associate - device not present\n");
@@ -2597,7 +2597,7 @@ static int ray_cs_proc_show(struct seq_file *m, void *v)
     link = this_device;
     if (!link)
     	return 0;
-    dev = (struct net_device *)link->priv;
+    dev = netdev_priv((struct net_device *)link);
     if (!dev)
     	return 0;
     local = netdev_priv(dev);
-- 
1.5.6.3

-- 
Jianjun Kong |Happy Hacking
Homepage: http://kongove.cn
Gtalk:kongjianjun@gmail.com

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: Kill directly reference of netdev->priv
  2008-12-09  1:32   ` Jianjun Kong
@ 2008-12-09  2:53     ` Wei Yongjun
  2008-12-09  7:34     ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: Wei Yongjun @ 2008-12-09  2:53 UTC (permalink / raw)
  To: Jianjun Kong; +Cc: David Miller, netdev

Jianjun Kong wrote:
> another new patch for net-next-2.6
> ---
>
> >From fbd6be20695810f32aa58a5cd889f959d87a019f Mon Sep 17 00:00:00 2001
> From: Jianjun Kong <jianjun@zeuux.org>
> Date: Tue, 9 Dec 2008 09:23:54 +0800
> Subject: [PATCH] net: Kill directly reference of netdev->priv
>
> drivers/net/wireless/ray_cs.c:
> Replace "(struct net_device *)link->priv" with "netdev_priv((struct net_device *)link)"
>   

You had tested this patch? Do you think your patch is correct? Stop do 
stupid things like this. This only make youself unbelievable.

> Signed-off-by: Jianjun Kong <jianjun@zeuux.org>
> ---
>  drivers/net/wireless/ray_cs.c |   12 ++++++------
>  1 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
> index 81b71f0..828aa47 100644
> --- a/drivers/net/wireless/ray_cs.c
> +++ b/drivers/net/wireless/ray_cs.c
> @@ -412,7 +412,7 @@ static int ray_config(struct pcmcia_device *link)
>      int i;
>      win_req_t req;
>      memreq_t mem;
> -    struct net_device *dev = (struct net_device *)link->priv;
> +    struct net_device *dev = netdev_priv((struct net_device *)link);
>      ray_dev_t *local = netdev_priv(dev);
>  
>      DEBUG(1, "ray_config(0x%p)\n", link);
> @@ -784,7 +784,7 @@ static void join_net(u_long data)
>  =============================================================================*/
>  static void ray_release(struct pcmcia_device *link)
>  {
> -    struct net_device *dev = link->priv; 
> +    struct net_device *dev = netdev_priv((struct net_device *)link);
>      ray_dev_t *local = netdev_priv(dev);
>      int i;
>      
> @@ -807,7 +807,7 @@ static void ray_release(struct pcmcia_device *link)
>  
>  static int ray_suspend(struct pcmcia_device *link)
>  {
> -	struct net_device *dev = link->priv;
> +	struct net_device *dev = netdev_priv((struct net_device *)link);
>  
>  	if (link->open)
>  		netif_device_detach(dev);
> @@ -817,7 +817,7 @@ static int ray_suspend(struct pcmcia_device *link)
>  
>  static int ray_resume(struct pcmcia_device *link)
>  {
> -	struct net_device *dev = link->priv;
> +	struct net_device *dev = netdev_priv((struct net_device *)link);
>  
>  	if (link->open) {
>  		ray_reset(dev);
> @@ -2505,7 +2505,7 @@ static void associate(ray_dev_t *local)
>  {
>      struct ccs __iomem *pccs;
>      struct pcmcia_device *link = local->finder;
> -    struct net_device *dev = link->priv;
> +    struct net_device *dev = netdev_priv((struct net_device *)link);
>      int ccsindex;
>      if (!(pcmcia_dev_present(link))) {
>          DEBUG(2,"ray_cs associate - device not present\n");
> @@ -2597,7 +2597,7 @@ static int ray_cs_proc_show(struct seq_file *m, void *v)
>      link = this_device;
>      if (!link)
>      	return 0;
> -    dev = (struct net_device *)link->priv;
> +    dev = netdev_priv((struct net_device *)link);
>      if (!dev)
>      	return 0;
>      local = netdev_priv(dev);
>   


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net: Kill directly reference of netdev->priv
  2008-12-09  1:32   ` Jianjun Kong
  2008-12-09  2:53     ` Wei Yongjun
@ 2008-12-09  7:34     ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2008-12-09  7:34 UTC (permalink / raw)
  To: jianjun; +Cc: netdev

From: Jianjun Kong <jianjun@zeuux.org>
Date: Tue, 9 Dec 2008 09:32:41 +0800

> 
> another new patch for net-next-2.6

Please stop sending these patches, I am ignoring all of them.

I told you that all the conversions have been done already
and these casts you are doing here are unbelievably ugly
and are a big red flag indicating that your patches are wrong.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-12-09  7:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-08 14:53 [PATCH] net: Kill directly reference of netdev->priv Jianjun Kong
2008-12-08 20:27 ` David Miller
2008-12-09  1:32   ` Jianjun Kong
2008-12-09  2:53     ` Wei Yongjun
2008-12-09  7:34     ` David Miller

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).