backports: enhance 0001-netdev_ops.cocci with data structure specifics
The 0001-netdev_ops.cocci is fine but is uses Expression which
makes the interpretation loose. We can reduce the namespace of
the change by using struct. We have to keep expression on the
right hand side as that can even be macros.
For a full example test coverage of this change see the test netdev-ops
github tree and run:
make test1
git checkout -f
make test2
The benefits should be clear, we are *not* modifying data structures
that have similar names. This increases accuracy and security of our
changes. The added run time penalty however is 50 seconds since we had
to use --recursive-includes. The time penatly is worth it for the
accuracy provided and since we'll likley need this flag elsewhere for
other rules.
mcgrof@drvbp1 ~/backports (git::master)$ time \
./gentree.py --clean --refresh \
/home/mcgrof/linux-next \
/home/mcgrof/build/next-
20140311
Copy original source files ...
Apply patches ...
Modify Kconfig tree ...
Rewrite Makefiles and Kconfig files ...
Done!
real 1m56.339s
user 19m31.428s
sys 0m50.100s
1 2.6.25 [ OK ]
2 2.6.26 [ OK ]
3 2.6.27 [ OK ]
4 2.6.28 [ OK ]
5 2.6.29 [ OK ]
6 2.6.30 [ OK ]
7 2.6.31 [ OK ]
8 2.6.32 [ OK ]
9 2.6.33 [ OK ]
10 2.6.34 [ OK ]
11 2.6.35 [ OK ]
12 2.6.36 [ OK ]
13 2.6.37 [ OK ]
14 2.6.38 [ OK ]
15 2.6.39 [ OK ]
16 3.0.101 [ OK ]
17 3.1.10 [ OK ]
18 3.2.54 [ OK ]
19 3.3.8 [ OK ]
20 3.4.79 [ OK ]
21 3.5.7 [ OK ]
22 3.6.11 [ OK ]
23 3.7.10 [ OK ]
24 3.8.13 [ OK ]
25 3.9.11 [ OK ]
26 3.10.29 [ OK ]
27 3.11.10 [ OK ]
28 3.12.10 [ OK ]
29 3.13.2 [ OK ]
30 3.14-rc1 [ OK ]
[0] https://github.com/mcgrof/netdev-ops
Cc: Peter Senna <peter.senna@gmail.com>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Gilles Muller <Gilles.Muller@lip6.fr>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>