Thread (123 messages) flat view 123 messages, 21 authors, 2014-06-23

Re: [PATCH 23/24] net, diet: Add coccinelle script to convert drivers to ETHTOOL_OPS

From: Nicolas Palix <nicolas.palix@imag.fr>
Date: 2014-05-06 09:27:50
Also in: lkml

Hi David,

I saw you rejected almost the entire patch series.

However, is there any interest to enforce the use of SET_ETHTOOL_OPS ?
Are you likely to merge the patch 24/24 [1] ?

Regards,

[1] https://lkml.org/lkml/2014/5/5/679


On Tue, May 6, 2014 at 12:26 AM, Andi Kleen [off-list ref] wrote:
quoted hunk ↗ jump to hunk
From: Andi Kleen <redacted>

Useful to remove unneeded driver code when ethtool is disabled.

The patches doing this are submitted too, but let's add
the script too so people can re-use it.

Cc: Julia Lawall <redacted>
Cc: Gilles Muller <redacted>
Cc: Nicolas Palix <nicolas.palix@imag.fr>
Signed-off-by: Andi Kleen <redacted>
---
 scripts/coccinelle/api/ethtool_ops.cocci | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 scripts/coccinelle/api/ethtool_ops.cocci
diff --git a/scripts/coccinelle/api/ethtool_ops.cocci b/scripts/coccinelle/api/ethtool_ops.cocci
new file mode 100644
index 0000000..a7ee6ed
--- /dev/null
+++ b/scripts/coccinelle/api/ethtool_ops.cocci
@@ -0,0 +1,9 @@
+// Convert network drivers to use the SET_ETHTOOL_OPS macro
+// This allows to compile out the ethtool code when not needed.
+//
+@@
+struct ethtool_ops *ops;
+struct net_device *dev;
+@@
+-      dev->ethtool_ops = ops;
++      SET_ETHTOOL_OPS(dev, ops);
--
1.9.0


-- 
Nicolas Palix
Tel: +33 4 76 51 46 27
http://lig-membres.imag.fr/palix/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help