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 13:52:57 +0000	[thread overview]
Message-ID: <878x9cjy9y.fsf@wanadoo.fr> (raw)
In-Reply-To: <d858bca40707181524r30f501dcnd1ecf1b4e9d2af86@mail.gmail.com>

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

>>
>> That's what my new semantic patch does. But maybe I am now too
>> restrictive.
>
> Your patch is indeed missing some needed changes. I had a look in
> drivers/net/wireless only, and it appears that the following drivers
> would need to be worked on as well:
> airo
> arlan
> hostap
> prism54
> ray_cs
> wavelan
> wl3501
>
> and I assume there are much more in the whole drivers/net/.
>
> I'm not sure there is an easy way to do all the changes at once. I'm
> going to make the changes manually in the remaining drivers, but if
> there is a faster method, don't hesitate to stop me.

Yes, I can apply my simpler semantic patch on the file you 
have clearly identified as "safe" to do the transformation. 

The only thing is that I would like also to automate the
identification part where you know when it's safe or not. How do you
know that for instance it's safe to replace the dev->priv by
netpriv(dev) in airo.c ? How do you know the private structure is
allocated behind the struct netdevice ?

in airo.c there is 

static struct net_device *init_wifidev(struct airo_info *ai,
					struct net_device *ethdev)
{
	int err;
	struct net_device *dev = alloc_netdev(0, "wifi%d", wifi_setup);
	if (!dev)
		return NULL;
	dev->priv = ethdev->priv;
	dev->irq = ethdev->irq;
	dev->base_addr = ethdev->base_addr;
	dev->wireless_data = ethdev->wireless_data;
	memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len);
	err = register_netdev(dev);
	if (err<0) {
		free_netdev(dev);
		return NULL;
	}
	return dev;
}


So it does not look dev->priv is behind the freshly allocated
alloc_netdev.




>
> Best regards,
>
> Thomas


  parent reply	other threads:[~2007-07-19 13:52 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 ` netdev_priv() Yoann Padioleau
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 ` Yoann Padioleau [this message]
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=878x9cjy9y.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.