Commit f84df0b7 authored by Miaohe Lin's avatar Miaohe Lin Committed by Linus Torvalds

mm/hugeltb: remove redundant VM_BUG_ON() in region_add()

Patch series "Cleanup and fixup for hugetlb", v2.

This series contains cleanups to remove redundant VM_BUG_ON() and simplify
the return code.  Also this handles the error case in
hugetlb_fix_reserve_counts() correctly.  More details can be found in the
respective changelogs.

This patch (of 5):

The same VM_BUG_ON() check is already done in the callee.  Remove this
extra one to simplify the code slightly.

Link: https://lkml.kernel.org/r/20210410072348.20437-1-linmiaohe@huawei.com
Link: https://lkml.kernel.org/r/20210410072348.20437-2-linmiaohe@huawei.comSigned-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
Cc: Feilong Lin <linfeilong@huawei.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fbe37501
...@@ -553,7 +553,6 @@ static long region_add(struct resv_map *resv, long f, long t, ...@@ -553,7 +553,6 @@ static long region_add(struct resv_map *resv, long f, long t,
resv->adds_in_progress -= in_regions_needed; resv->adds_in_progress -= in_regions_needed;
spin_unlock(&resv->lock); spin_unlock(&resv->lock);
VM_BUG_ON(add < 0);
return add; return add;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment