[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1567592763-25282-1-git-send-email-zhongjiang@huawei.com>
Date: Wed, 4 Sep 2019 18:26:03 +0800
From: zhong jiang <zhongjiang@...wei.com>
To: <akpm@...ux-foundation.org>, <mhocko@...nel.org>
CC: <anshuman.khandual@....com>, <vbabka@...e.cz>,
<zhongjiang@...wei.com>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] mm: Unsigned 'nr_pages' always larger than zero
With the help of unsigned_lesser_than_zero.cocci. Unsigned 'nr_pages"'
compare with zero. And __get_user_pages_locked will return an long value.
Hence, Convert the long to compare with zero is feasible.
Signed-off-by: zhong jiang <zhongjiang@...wei.com>
---
mm/gup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/gup.c b/mm/gup.c
index 23a9f9c..956d5a1 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1508,7 +1508,7 @@ static long check_and_migrate_cma_pages(struct task_struct *tsk,
pages, vmas, NULL,
gup_flags);
- if ((nr_pages > 0) && migrate_allow) {
+ if (((long)nr_pages > 0) && migrate_allow) {
drain_allow = true;
goto check_again;
}
--
1.7.12.4
Powered by blists - more mailing lists