From: Rakib Mullick Date: Wed, 2 Nov 2011 20:40:04 +0000 (-0700) Subject: drivers/misc/vmw_balloon.c: determine page allocation flag can_sleep outside loop X-Git-Tag: v3.2-rc1~82^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6d994a7e42ab219ba3c10d5ffccf20990252881e;p=profile%2Fivi%2Fkernel-x86-ivi.git drivers/misc/vmw_balloon.c: determine page allocation flag can_sleep outside loop In vmballoon_reserve_page(), flags has been passed from the callee function (vmballoon_inflate here). So, we can determine can_sleep outside the loop. Signed-off-by: Rakib Mullick Acked-by: Dmitry Torokhov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index 053d36c..6983d80 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c @@ -412,6 +412,7 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep) gfp_t flags; unsigned int hv_status; bool locked = false; + flags = can_sleep ? VMW_PAGE_ALLOC_CANSLEEP : VMW_PAGE_ALLOC_NOSLEEP; do { if (!can_sleep) @@ -419,7 +420,6 @@ static int vmballoon_reserve_page(struct vmballoon *b, bool can_sleep) else STATS_INC(b->stats.sleep_alloc); - flags = can_sleep ? VMW_PAGE_ALLOC_CANSLEEP : VMW_PAGE_ALLOC_NOSLEEP; page = alloc_page(flags); if (!page) { if (!can_sleep)