From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751954AbbI0SEk (ORCPT ); Sun, 27 Sep 2015 14:04:40 -0400 Received: from mail-wi0-f194.google.com ([209.85.212.194]:35640 "EHLO mail-wi0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751118AbbI0SEj (ORCPT ); Sun, 27 Sep 2015 14:04:39 -0400 Date: Sun, 27 Sep 2015 21:04:16 +0000 From: Alexandru Moise <00moses.alexander00@gmail.com> To: akpm@linux-foundation.org Cc: mgorman@suse.de, vbabka@suse.cz, mhocko@suse.com, rientjes@google.com, js1304@gmail.com, hannes@cmpxchg.org, alexander.h.duyck@redhat.com, sasha.levin@oracle.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mm: change free_cma and free_pages declarations to unsigned Message-ID: <20150927210416.GA20144@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Their stored values come from zone_page_state() which returns an unsigned long. To improve code correctness we should avoid mixing signed and unsigned integers. Signed-off-by: Alexandru Moise <00moses.alexander00@gmail.com> --- mm/page_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 48aaf7b..f55e3a2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2242,7 +2242,7 @@ static bool __zone_watermark_ok(struct zone *z, unsigned int order, /* free_pages may go negative - that's OK */ long min = mark; int o; - long free_cma = 0; + unsigned long free_cma = 0; free_pages -= (1 << order) - 1; if (alloc_flags & ALLOC_HIGH) @@ -2280,7 +2280,7 @@ bool zone_watermark_ok(struct zone *z, unsigned int order, unsigned long mark, bool zone_watermark_ok_safe(struct zone *z, unsigned int order, unsigned long mark, int classzone_idx, int alloc_flags) { - long free_pages = zone_page_state(z, NR_FREE_PAGES); + unsigned long free_pages = zone_page_state(z, NR_FREE_PAGES); if (z->percpu_drift_mark && free_pages < z->percpu_drift_mark) free_pages = zone_page_state_snapshot(z, NR_FREE_PAGES); -- 2.5.3