summaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2022-09-01 14:00:23 +0200
committerAndrew Morton <akpm@linux-foundation.org>2022-09-12 05:26:09 +0200
commit3466534131b28e1ee1e7cfd5c77d981ea41b20aa (patch)
tree14b031fd30c9ec3df9c0376a7932c846df73001e /mm/hugetlb.c
parenthugetlb: Use helper macro SZ_1K (diff)
downloadlinux-3466534131b28e1ee1e7cfd5c77d981ea41b20aa.tar.xz
linux-3466534131b28e1ee1e7cfd5c77d981ea41b20aa.zip
hugetlb: use LIST_HEAD() to define a list head
Use LIST_HEAD() directly to define a list head to simplify the code. No functional change intended. Link: https://lkml.kernel.org/r/20220901120030.63318-4-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index cebaa5d28b52..fddbda2a2b37 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -456,14 +456,12 @@ static int allocate_file_region_entries(struct resv_map *resv,
int regions_needed)
__must_hold(&resv->lock)
{
- struct list_head allocated_regions;
+ LIST_HEAD(allocated_regions);
int to_allocate = 0, i = 0;
struct file_region *trg = NULL, *rg = NULL;
VM_BUG_ON(regions_needed < 0);
- INIT_LIST_HEAD(&allocated_regions);
-
/*
* Check for sufficient descriptors in the cache to accommodate
* the number of in progress add operations plus regions_needed.
@@ -2336,7 +2334,7 @@ struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma,
static int gather_surplus_pages(struct hstate *h, long delta)
__must_hold(&hugetlb_lock)
{
- struct list_head surplus_list;
+ LIST_HEAD(surplus_list);
struct page *page, *tmp;
int ret;
long i;
@@ -2351,7 +2349,6 @@ static int gather_surplus_pages(struct hstate *h, long delta)
}
allocated = 0;
- INIT_LIST_HEAD(&surplus_list);
ret = -ENOMEM;
retry: