[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210402093249.25137-3-linmiaohe@huawei.com>
Date: Fri, 2 Apr 2021 05:32:47 -0400
From: Miaohe Lin <linmiaohe@...wei.com>
To: <akpm@...ux-foundation.org>, <mike.kravetz@...cle.com>
CC: <n-horiguchi@...jp.nec.com>, <hillf.zj@...baba-inc.com>,
<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
<linmiaohe@...wei.com>
Subject: [PATCH 2/4] mm/hugeltb: simplify the return code of __vma_reservation_common()
It's guaranteed that the vma is associated with a resv_map, i.e. either
VM_MAYSHARE or HPAGE_RESV_OWNER, when the code reaches here or we would
have returned via !resv check above. So ret must be less than 0 in the
'else' case. Simplify the return code to make this clear.
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
mm/hugetlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index a03a50b7c410..b7864abded3d 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2183,7 +2183,7 @@ static long __vma_reservation_common(struct hstate *h,
return 1;
}
else
- return ret < 0 ? ret : 0;
+ return ret;
}
static long vma_needs_reservation(struct hstate *h,
--
2.19.1
Powered by blists - more mailing lists