Skip to content

Commit

Permalink
Documentation/connector/cn_test.c: don't use gfp_any()
Browse files Browse the repository at this point in the history
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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
akpm00 authored and davem330 committed Feb 13, 2009
1 parent 9970937 commit f82da72
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Documentation/connector/cn_test.c
Expand Up @@ -137,7 +137,7 @@ static void cn_test_timer_func(unsigned long __data)

memcpy(m + 1, data, m->len);

cn_netlink_send(m, 0, gfp_any());
cn_netlink_send(m, 0, GFP_ATOMIC);
kfree(m);
}

Expand All @@ -160,10 +160,8 @@ static int cn_test_init(void)
goto err_out;
}

init_timer(&cn_test_timer);
cn_test_timer.function = cn_test_timer_func;
setup_timer(&cn_test_timer, cn_test_timer_func, 0);
cn_test_timer.expires = jiffies + HZ;
cn_test_timer.data = 0;
add_timer(&cn_test_timer);

return 0;
Expand Down

0 comments on commit f82da72

Please sign in to comment.