diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2009-02-12 19:47:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-12 19:47:01 -0500 |
commit | f82da723398ff18d49275a5f03de6cae5f592e8e (patch) | |
tree | acd95449d77d4b565baa71eb287d228a1e1fcbf4 /Documentation | |
parent | 99709372736a216f99eb32b76fba835a2bfc93a8 (diff) |
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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/connector/cn_test.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Documentation/connector/cn_test.c b/Documentation/connector/cn_test.c index be7af146dd30..6977c178729a 100644 --- a/Documentation/connector/cn_test.c +++ b/Documentation/connector/cn_test.c | |||
@@ -137,7 +137,7 @@ static void cn_test_timer_func(unsigned long __data) | |||
137 | 137 | ||
138 | memcpy(m + 1, data, m->len); | 138 | memcpy(m + 1, data, m->len); |
139 | 139 | ||
140 | cn_netlink_send(m, 0, gfp_any()); | 140 | cn_netlink_send(m, 0, GFP_ATOMIC); |
141 | kfree(m); | 141 | kfree(m); |
142 | } | 142 | } |
143 | 143 | ||
@@ -160,10 +160,8 @@ static int cn_test_init(void) | |||
160 | goto err_out; | 160 | goto err_out; |
161 | } | 161 | } |
162 | 162 | ||
163 | init_timer(&cn_test_timer); | 163 | setup_timer(&cn_test_timer, cn_test_timer_func, 0); |
164 | cn_test_timer.function = cn_test_timer_func; | ||
165 | cn_test_timer.expires = jiffies + HZ; | 164 | cn_test_timer.expires = jiffies + HZ; |
166 | cn_test_timer.data = 0; | ||
167 | add_timer(&cn_test_timer); | 165 | add_timer(&cn_test_timer); |
168 | 166 | ||
169 | return 0; | 167 | return 0; |