From: Andrew Morton Date: Wed, 20 Feb 2013 02:14:02 +0000 (+1100) Subject: mm/page_alloc.c:__setup_per_zone_wmarks: make min_pages unsigned long X-Git-Tag: next-20130220~1^2~582 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=51c4ada6d4d92bf72f18a6412e75d58701260455;p=karo-tx-linux.git mm/page_alloc.c:__setup_per_zone_wmarks: make min_pages unsigned long `int' is an inappropriate type for a number-of-pages counter. While we're there, use the clamp() macro. Acked-by: Johannes Weiner Cc: Rik van Riel Cc: Mel Gorman Reviewed-by: Michal Hocko Cc: Hugh Dickins Cc: Satoru Moriya Cc: Simon Jeons Signed-off-by: Andrew Morton --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 9acd27e5dc2b..edb95fc67e70 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5247,13 +5247,10 @@ static void __setup_per_zone_wmarks(void) * deltas controls asynch page reclaim, and so should * not be capped for highmem. */ - int min_pages; + unsigned long min_pages; min_pages = zone->present_pages / 1024; - if (min_pages < SWAP_CLUSTER_MAX) - min_pages = SWAP_CLUSTER_MAX; - if (min_pages > 128) - min_pages = 128; + min_pages = clamp(min_pages, SWAP_CLUSTER_MAX, 128UL); zone->watermark[WMARK_MIN] = min_pages; } else { /*