From bba08ecedaf97bd4bbb991e32b89eb81ad017da6 Mon Sep 17 00:00:00 2001 From: Derry Date: Tue, 26 May 2020 06:29:54 -0700 Subject: [PATCH] oaf:fix compile error in kernel v4.15+ --- oaf/src/app_filter.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/oaf/src/app_filter.c b/oaf/src/app_filter.c index 35d7c51..97f3d7a 100755 --- a/oaf/src/app_filter.c +++ b/oaf/src/app_filter.c @@ -902,7 +902,11 @@ void TEST_cJSON(void) struct timer_list oaf_timer; #define OAF_TIMER_INTERVAL 15 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0) +static void oaf_timer_func(struct timer_list *t) +#else static void oaf_timer_func(unsigned long ptr) +#endif { // check_client_expire(); af_visit_info_timer_handle(); @@ -912,7 +916,11 @@ static void oaf_timer_func(unsigned long ptr) void init_oaf_timer(void) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0) + timer_setup(&oaf_timer, oaf_timer_func, 0); +#else setup_timer(&oaf_timer, oaf_timer_func, OAF_TIMER_INTERVAL * HZ); +#endif mod_timer(&oaf_timer, jiffies + OAF_TIMER_INTERVAL * HZ); AF_INFO("init oaf timer...ok"); }