diff mbox series

[3/3] backports: add kthread.h

Message ID 20220128095230.0d32af21ba08.I0c3c1ed3d75dcd800d0a4ef41943a4db10ea5df4@changeid (mailing list archive)
State New, archived
Headers show
Series [1/3] patches: add spatch to adjust to changed ethtool ringparam API | expand

Commit Message

Johannes Berg Jan. 28, 2022, 8:52 a.m. UTC
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 mbox series

Patch

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 */