All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoann Padioleau <padator@wanadoo.fr>
To: kernel-janitors@vger.kernel.org
Subject: Re: netdev_priv()
Date: Thu, 19 Jul 2007 07:51:18 +0000	[thread overview]
Message-ID: <87zm1sn85l.fsf@wanadoo.fr> (raw)
In-Reply-To: <d858bca40707181524r30f501dcnd1ecf1b4e9d2af86@mail.gmail.com>

"Thomas Surrel" <thomas.surrel@gmail.com> writes:

> Hi,
>
> I'm starting to work on the change to netdev_priv() call to access the
> priv field of the net_device structure. Is anybody already working on
> this ?

Yes, I am working a little on it. I already have written 
a semantic patch that does the transformation: 

@@
struct net_device *dev;
type T;
@@

- (T) dev->priv
+ netdev_priv(dev)


The end of this mail contains an excerpt of the patch generated
by my automatic program transformation tool given the semantic patch 
for drivers/net/arcnet/

>
> Also, what is the best way to organize my patches: one per subsystem
> (wireless, token ring, ...) or even more detailed which would imply a
> lot more patches ?

From what I understand Morton prefers patch per subsystem.
Maybe I can submit the patch generated automatically by my tool
and later you can try to find the remaining case that my tool
does not handle ? 

>
> Regards,
>
> Thomas
> -
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index 681e20b..d595f4f 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -353,7 +353,7 @@ struct net_device *alloc_arcdev(char *na
 	dev = alloc_netdev(sizeof(struct arcnet_local),
 			   name && *name ? name : "arc%d", arcdev_setup);
 	if(dev) {
-		struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
+		struct arcnet_local *lp = netdev_priv(dev);
 		spin_lock_init(&lp->lock);
 	}
 
diff --git a/drivers/net/arcnet/capmode.c b/drivers/net/arcnet/capmode.c
index cc4610d..bd04be9 100644
--- a/drivers/net/arcnet/capmode.c
+++ b/drivers/net/arcnet/capmode.c
@@ -101,7 +101,7 @@ #endif				/* MODULE */
 static void rx(struct net_device *dev, int bufnum,
 	       struct archdr *pkthdr, int length)
 {
-	struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
+	struct arcnet_local *lp = netdev_priv(dev);
 	struct sk_buff *skb;
 	struct archdr *pkt = pkthdr;
 	char *pktbuf, *pkthdrbuf;
@@ -196,7 +196,7 @@ static int build_header(struct sk_buff *
 static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
 		      int bufnum)
 {
-	struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
+	struct arcnet_local *lp = netdev_priv(dev);
 	struct arc_hardware *hard = &pkt->hard;
 	int ofs;
 
@@ -248,7 +248,7 @@ static int prepare_tx(struct net_device 
 
 static int ack_tx(struct net_device *dev, int acked)
 {
-  struct arcnet_local *lp = (struct arcnet_local *) dev->priv;
+  struct arcnet_local *lp = netdev_priv(dev);
   struct sk_buff *ackskb;
   struct archdr *ackpkt;
   int length=sizeof(struct arc_cap);


  parent reply	other threads:[~2007-07-19  7:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-18 22:24 netdev_priv() Thomas Surrel
2007-07-19  7:25 ` netdev_priv() pradeep singh
2007-07-19  7:51 ` Yoann Padioleau [this message]
2007-07-19  8:18 ` netdev_priv() Yoann Padioleau
2007-07-19  8:57 ` netdev_priv() Thomas Surrel
2007-07-19  9:01 ` netdev_priv() Thomas Surrel
2007-07-19  9:14 ` netdev_priv() pradeep singh
2007-07-19 11:49 ` netdev_priv() Yoann Padioleau
2007-07-19 13:27 ` netdev_priv() Thomas Surrel
2007-07-19 13:34 ` netdev_priv() Alexey Dobriyan
2007-07-19 13:52 ` netdev_priv() Yoann Padioleau
2007-07-19 13:59 ` netdev_priv() Yoann Padioleau
2007-07-19 14:33 ` netdev_priv() Thomas Surrel
2007-07-19 15:22 ` netdev_priv() pradeep singh
2007-07-19 15:35 ` netdev_priv() Yoann Padioleau
2007-07-19 15:57 ` netdev_priv() Thomas Surrel
2007-07-19 17:06 ` netdev_priv() Yoann Padioleau
2007-07-20  8:20 ` netdev_priv() Thomas Surrel
2007-07-20 10:41 ` netdev_priv() Yoann Padioleau

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=87zm1sn85l.fsf@wanadoo.fr \
    --to=padator@wanadoo.fr \
    --cc=kernel-janitors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.