Commit f82da723 authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

Documentation/connector/cn_test.c: don't use gfp_any()

cn_test_timer_func() is a timer handler and can never use GFP_KERNEL -
there's no point in using gfp_any() here.

Also, use setup_timer().
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 99709372
...@@ -137,7 +137,7 @@ static void cn_test_timer_func(unsigned long __data) ...@@ -137,7 +137,7 @@ static void cn_test_timer_func(unsigned long __data)
memcpy(m + 1, data, m->len); memcpy(m + 1, data, m->len);
cn_netlink_send(m, 0, gfp_any()); cn_netlink_send(m, 0, GFP_ATOMIC);
kfree(m); kfree(m);
} }
...@@ -160,10 +160,8 @@ static int cn_test_init(void) ...@@ -160,10 +160,8 @@ static int cn_test_init(void)
goto err_out; goto err_out;
} }
init_timer(&cn_test_timer); setup_timer(&cn_test_timer, cn_test_timer_func, 0);
cn_test_timer.function = cn_test_timer_func;
cn_test_timer.expires = jiffies + HZ; cn_test_timer.expires = jiffies + HZ;
cn_test_timer.data = 0;
add_timer(&cn_test_timer); add_timer(&cn_test_timer);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment