lkml.org 
[lkml]   [2007]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 06/13] dev->priv to netdev_priv(dev), for drivers/net/ibm_emac
Date
Eugene Surovegin <ebs@ebshome.net> writes:

> On Fri, Aug 03, 2007 at 07:34:19PM +0200, Yoann Padioleau wrote:
>>
>> 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.
>
> NAK.
>
> While that assumption is correct for the actual emac net device, it's
> not for MAL poll one.

I forgot to add another condition in my semantic patch.

I was looking only for xxx->priv = yyy;
with this rule:

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

whereas sometimes it's written xxx.priv = yyy;
as in ibm_emac_mal ( mal->poll_dev.priv = mal; )

By adding the following rule in my semantic patch I correctly
_dont_ modify anything under drivers/net/ibm_emac

@ danger @
struct net_device dev;
expression E;
@@
dev.priv = E


It's also the case for drivers/net/e1000/e1000_main.c.


>
> You patch breaks a working driver.
>
> --
> Eugene

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-03 20:31    [W:1.313 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site