From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: [PATCH 23/24] net, diet: Add coccinelle script to convert drivers to ETHTOOL_OPS Date: Mon, 5 May 2014 15:26:12 -0700 Message-ID: <1399328773-6531-24-git-send-email-andi@firstfloor.org> References: <1399328773-6531-1-git-send-email-andi@firstfloor.org> Cc: linux-kernel@vger.kernel.org, tom.zanussi@linux.intel.com, Andi Kleen , Julia Lawall , Gilles Muller , Nicolas Palix To: netdev@vger.kernel.org Return-path: In-Reply-To: <1399328773-6531-1-git-send-email-andi@firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org From: Andi Kleen 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 Cc: Gilles Muller Cc: Nicolas Palix Signed-off-by: Andi Kleen --- 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