[PATCH 1/3] patches: add spatch to adjust to changed ethtool ringparam API

Johannes Berg <[email protected]>
Newsgroups org.kernel.vger.backports
Message-ID <20220128095230.da47bbe7d248.I29005f305b7808de21837d75e992b07444b4eaaa@changeid>
From: Johannes Berg <[email protected]>

This changed in 5.17-rc1, so add the necessary ifdefs via a
new spatch.

ticket=none

Signed-off-by: Johannes Berg <[email protected]>
---
 patches/0106-ethtool-ringparam.cocci | 45 ++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 patches/0106-ethtool-ringparam.cocci

diff --git a/patches/0106-ethtool-ringparam.cocci b/patches/0106-ethtool-ringparam.cocci
new file mode 100644
index 000000000000..6f78668e37b6
--- /dev/null
+++ b/patches/0106-ethtool-ringparam.cocci
@@ -0,0 +1,45 @@
+@set@
+identifier ops, fn;
+@@
+const struct ethtool_ops ops = {
+  .set_ringparam = fn,
+  ...
+};
+
+@@
+identifier set.fn;
+identifier dev, rp;
+@@
+int fn(struct net_device *dev,
+       struct ethtool_ringparam *rp
++#if LINUX_VERSION_IS_GEQ(5,17,0)
++      , struct kernel_ethtool_ringparam *krp,
++      struct netlink_ext_ack *extack
++#endif
+      )
+{
+...
+}
+
+@get@
+identifier ops, fn;
+@@
+const struct ethtool_ops ops = {
+  .get_ringparam = fn,
+  ...
+};
+
+@@
+identifier get.fn;
+identifier dev, rp;
+@@
+void fn(struct net_device *dev,
+        struct ethtool_ringparam *rp
++#if LINUX_VERSION_IS_GEQ(5,17,0)
++       , struct kernel_ethtool_ringparam *krp,
++       struct netlink_ext_ack *extack
++#endif
+       )
+{
+...
+}
-- 
2.34.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.