Patchwork net: Kill directly reference of netdev->priv

login
register
mail settings
Submitter Jianjun kong
Date Dec. 9, 2008, 1:32 a.m.
Message ID <20081209013241.GA15483@ubuntu>
Download mbox | patch
Permalink /patch/12875/
State Rejected
Delegated to: David Miller
Headers show

Comments

Jianjun kong - Dec. 9, 2008, 1:32 a.m.
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(-)
Wei Yongjun - Dec. 9, 2008, 2:53 a.m.
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);
>   

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Dec. 9, 2008, 7:34 a.m.
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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