Files
android_kernel_xiaomi_sm8450/drivers/net
Yoann Padioleau eda105317f dev->priv to netdev_priv(dev), drivers/net/tokenring/
Replacing accesses to dev->priv to netdev_priv(dev). The replacment
is safe when netdev_priv is used to access a private structure that is
right next to the net_device structure in memory.
Cf http://groups.google.com/group/comp.os.linux.development.system/browse_thread/thread/de19321bcd94dbb8/0d74a4adcd6177bd
This is the case when the net_device structure was allocated with
a call to alloc_netdev or one of its derivative.

Here is an excerpt of the semantic patch that performs the transformation

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

 dev =
(
        alloc_netdev
|
        alloc_etherdev
|
        alloc_trdev
)
   (sizeof(T), ...)

@ rule1bis @
struct net_device *dev;
expression E;
@@
 dev->priv = E

@ rule2 depends on rule1 && !rule1bis  @
struct net_device *dev;
type rule1.T;
@@

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

PS: I have performed the same transformation on the whole kernel
and it affects around 70 files, most of them in drivers/net/.
Should I split my patch for each subnet directories ? (wireless/, wan/, etc)

Thanks to Thomas Surrel for helping me refining my semantic patch.

Signed-off-by: Yoann Padioleau <padator@wanadoo.fr>

 3c359.c       |   58 +++++++++++++++++++++++++++++-----------------------------
 ibmtr.c       |   38 +++++++++++++++++++-------------------
 lanstreamer.c |   32 ++++++++++++++++----------------
 madgemc.c     |    4 ++--
 olympic.c     |   36 ++++++++++++++++++------------------
 tmspci.c      |    4 ++--
 6 files changed, 86 insertions(+), 86 deletions(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10 16:50:19 -07:00
..
2007-05-24 16:36:51 -07:00
2007-09-12 23:54:50 -04:00
2007-10-10 16:47:47 -07:00
2007-10-10 16:47:47 -07:00
2007-09-20 02:35:50 -04:00
2007-09-15 19:35:14 -04:00
2007-10-02 12:59:10 -04:00
2007-08-14 01:38:37 -04:00
2007-02-09 09:14:07 -08:00
2006-09-13 13:24:59 -04:00
2006-09-13 13:24:59 -04:00
2007-07-10 22:08:12 -07:00
2006-09-13 13:24:59 -04:00
2006-09-13 13:24:59 -04:00
2007-07-10 22:08:12 -07:00
2006-09-13 13:24:59 -04:00
2007-07-10 12:41:08 -04:00
2007-07-10 22:08:12 -07:00
2006-09-13 13:24:59 -04:00
2007-02-09 09:14:07 -08:00
2007-07-10 22:08:12 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2007-07-10 22:08:12 -07:00
2007-08-14 01:34:53 -04:00
2006-09-13 13:24:59 -04:00
2007-05-03 13:21:48 -07:00
2007-05-03 13:21:13 -07:00
2006-09-13 13:24:59 -04:00
2005-04-16 15:20:36 -07:00
2007-02-09 16:23:17 +00:00
2006-09-13 13:24:59 -04:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2006-09-13 13:24:59 -04:00
2007-08-25 02:31:04 -04:00
2005-05-15 18:31:07 -04:00
2007-02-09 09:14:07 -08:00
2007-05-09 08:57:56 +02:00
2007-02-09 09:14:07 -08:00
2006-09-13 13:24:59 -04:00
2007-07-10 22:08:12 -07:00
2007-07-30 15:48:16 -04:00
2007-07-30 15:48:16 -04:00
2007-07-10 22:08:12 -07:00
2006-09-13 13:24:59 -04:00
2006-12-09 09:41:18 -08:00
2005-04-16 15:20:36 -07:00
2006-12-02 00:11:56 -05:00
2007-08-31 06:52:57 -04:00
2007-05-04 17:59:08 -07:00
2007-07-26 11:35:17 -07:00
2005-04-16 15:20:36 -07:00
2007-07-20 08:24:49 -07:00
2007-05-04 17:59:07 -07:00
2005-04-16 15:20:36 -07:00
2007-07-10 12:41:18 -04:00
2007-05-04 17:59:08 -07:00
2007-08-25 02:30:59 -04:00
2007-05-09 08:57:56 +02:00
2007-04-28 11:01:05 -04:00
2006-12-04 02:00:34 -05:00
2007-07-10 22:08:12 -07:00
2006-09-13 13:24:59 -04:00
2007-07-10 22:08:12 -07:00
2006-09-13 13:24:59 -04:00
2007-07-18 18:29:38 -04:00
2005-04-16 15:20:36 -07:00
2007-07-18 18:29:37 -04:00
2007-07-10 22:08:12 -07:00
2007-04-25 22:24:41 -07:00
2007-07-30 15:56:04 -04:00
2007-07-18 18:29:38 -04:00
2007-07-10 12:24:42 -04:00
2006-09-13 13:24:59 -04:00
2006-09-13 13:24:59 -04:00
2007-08-26 18:35:39 -07:00
2006-09-13 13:24:59 -04:00
2007-05-15 17:44:39 -04:00
2007-02-09 09:14:07 -08:00
2007-02-09 09:14:07 -08:00
2007-05-04 17:59:08 -07:00
2007-07-16 15:02:47 +02:00
2005-04-16 15:20:36 -07:00
2007-07-10 22:08:12 -07:00
2007-07-10 22:08:12 -07:00
2007-07-10 22:08:12 -07:00
2007-07-10 22:08:12 -07:00
2005-04-16 15:20:36 -07:00
2007-10-10 16:49:00 -07:00
2006-11-22 14:57:56 +00:00
2007-08-03 16:07:58 +08:00
2007-07-31 15:39:40 -07:00
2007-02-09 09:14:07 -08:00
2007-07-10 22:08:12 -07:00
2006-12-02 00:11:56 -05:00