From ebcc0426c50fe5f2ec28b64edca677a3c7d8b377 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Fri, 23 Sep 2011 17:48:05 -0400 Subject: [PATCH] compat: provide INIT_WORK with 2 arguments for kernels before 2.6.20 Also provide work_func_t. Originally implemented and tested in ndiswrapper. Signed-off-by: Pavel Roskin --- include/linux/compat-2.6.20.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/linux/compat-2.6.20.h diff --git a/include/linux/compat-2.6.20.h b/include/linux/compat-2.6.20.h new file mode 100644 index 000000000000..14579e29cf8e --- /dev/null +++ b/include/linux/compat-2.6.20.h @@ -0,0 +1,21 @@ +#ifndef LINUX_26_20_COMPAT_H +#define LINUX_26_20_COMPAT_H + +#include + +/* Compat work for 2.6.20 */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) + +#include + +typedef void (*work_func_t)(struct work_struct *work); +typedef void (*compat_work_func_t)(void *work); +static inline void (INIT_WORK)(struct work_struct *work, work_func_t func) +{ + INIT_WORK(work, (compat_work_func_t)func, work); +} +#undef INIT_WORK + +#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)) */ + +#endif /* LINUX_26_20_COMPAT_H */ -- 2.30.2