backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] patches: add spatch to adjust to changed ethtool ringparam API
@ 2022-01-28  8:52 Johannes Berg
  2022-01-28  8:52 ` [PATCH 2/3] main: add module_exit() Johannes Berg
  2022-01-28  8:52 ` [PATCH 3/3] backports: add kthread.h Johannes Berg
  0 siblings, 2 replies; 3+ messages in thread
From: Johannes Berg @ 2022-01-28  8: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.

ticket=none

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..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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] main: add module_exit()
  2022-01-28  8:52 [PATCH 1/3] patches: add spatch to adjust to changed ethtool ringparam API Johannes Berg
@ 2022-01-28  8:52 ` Johannes Berg
  2022-01-28  8:52 ` [PATCH 3/3] backports: add kthread.h Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2022-01-28  8:52 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This is needed since we have module_init() and otherwise
the kernel cannot unload the module again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/compat/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/backport/compat/main.c b/backport/compat/main.c
index 2540e7573674..d4f3340dba48 100644
--- a/backport/compat/main.c
+++ b/backport/compat/main.c
@@ -72,3 +72,8 @@ static int __init backport_init(void)
         return 0;
 }
 subsys_initcall(backport_init);
+
+static void __exit backport_exit(void)
+{
+}
+module_exit(backport_exit);
-- 
2.34.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 3/3] backports: add kthread.h
  2022-01-28  8:52 [PATCH 1/3] patches: add spatch to adjust to changed ethtool ringparam API Johannes Berg
  2022-01-28  8:52 ` [PATCH 2/3] main: add module_exit() Johannes Berg
@ 2022-01-28  8:52 ` Johannes Berg
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2022-01-28  8:52 UTC (permalink / raw)
  To: backports; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

In 5.17, complete_and_exit() gets replaced by
kthread_complete_and_exit(), so support that API.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/kthread.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 backport/backport-include/linux/kthread.h

diff --git a/backport/backport-include/linux/kthread.h b/backport/backport-include/linux/kthread.h
new file mode 100644
index 000000000000..0b36bdcc2d2a
--- /dev/null
+++ b/backport/backport-include/linux/kthread.h
@@ -0,0 +1,12 @@
+#ifndef __BACKPORT_LINUX_KTHREAD_H
+#define __BACKPORT_LINUX_KTHREAD_H
+#include_next <linux/kthread.h>
+
+#if LINUX_VERSION_IS_LESS(5,17,0)
+static inline void kthread_complete_and_exit(struct completion *c, long ret)
+{
+	complete_and_exit(c, ret);
+}
+#endif /* < 5.17 */
+
+#endif /* __BACKPORT_LINUX_KTHREAD_H */
-- 
2.34.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-28  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-28  8:52 [PATCH 1/3] patches: add spatch to adjust to changed ethtool ringparam API Johannes Berg
2022-01-28  8:52 ` [PATCH 2/3] main: add module_exit() Johannes Berg
2022-01-28  8:52 ` [PATCH 3/3] backports: add kthread.h 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).