* [PATCH v2] patches: add spatch to adjust to changed ethtool ringparam API
@ 2022-02-21 10:52 Johannes Berg
0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2022-02-21 10:52 UTC (permalink / raw)
To: backports; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
This changed in 5.17-rc1, so add the necessary ifdefs via a
new spatch.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
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..7b72f391b140
--- /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.35.1
--
To unsubscribe from this list: send the line "unsubscribe backports" in
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-02-21 11:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-21 10:52 [PATCH v2] patches: add spatch to adjust to changed ethtool ringparam API Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).