Skip to contentSkip to conversation

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

PATCH Applied [email protected] 3 participants 3 messages Feb 11, 2009 – Feb 13, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

From: Andrew Morton <[email protected]>

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().

Cc Evgeniy Polyakov <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Andi Kleen <[email protected]>

---

 Documentation/connector/cn_test.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Documentation/connector/cn_test.c renamed from Documentation/connector/cn_test.c~documentation-connector-cn_testc-dont-use-gfp_any +2 -4
diff -puN Documentation/connector/cn_test.c~documentation-connector-cn_testc-dont-use-gfp_any Documentation/connector/cn_test.c
@@ -137,7 +137,7 @@ static void cn_test_timer_func(unsigned 
 
 		memcpy(m + 1, data, m->len);
 
-		cn_netlink_send(m, 0, gfp_any());
+		cn_netlink_send(m, 0, GFP_ATOMIC);
 		kfree(m);
 	}
 
@@ -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;

_

#1 lore raw
Quoted 11 lines · On Wed, Feb 11, 2009 at 01:27:19PM -0800, [email protected]…

From: Andrew Morton <[email protected]>

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().

Cc Evgeniy Polyakov <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Andi Kleen <[email protected]>

Looks good for the documentation update :)
Thank you.

Signature · 1 line
	Evgeniy Polyakov