aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorXU pengfei <xupengfei@nfschina.com>2022-09-14 09:21:14 +0800
committerAndrew Morton <akpm@linux-foundation.org>2022-10-03 14:03:15 -0700
commit3259914f8cab1bab3fe691a90ac3c47411cb0aba (patch)
tree04398eb78c6b4e3c74233f425eeececa0eabdfff /mm/hugetlb.c
parentmm/filemap: make folio_put_wait_locked static (diff)
downloadlinux-dev-3259914f8cab1bab3fe691a90ac3c47411cb0aba.tar.xz
linux-dev-3259914f8cab1bab3fe691a90ac3c47411cb0aba.zip
mm/hugetlb: remove unnecessary 'NULL' values from pointer
Pointer variables allocate memory first, and then judge. There is no need to initialize the assignment. Link: https://lkml.kernel.org/r/20220914012113.6271-1-xupengfei@nfschina.com Signed-off-by: XU pengfei <xupengfei@nfschina.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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 0b1ab5af939e..d4347ae337fb 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -258,7 +258,7 @@ static inline struct hugepage_subpool *subpool_vma(struct vm_area_struct *vma)
static struct file_region *
get_file_region_entry_from_cache(struct resv_map *resv, long from, long to)
{
- struct file_region *nrg = NULL;
+ struct file_region *nrg;
VM_BUG_ON(resv->region_cache_count <= 0);
@@ -340,7 +340,7 @@ static bool has_same_uncharge_info(struct file_region *rg,
static void coalesce_file_region(struct resv_map *resv, struct file_region *rg)
{
- struct file_region *nrg = NULL, *prg = NULL;
+ struct file_region *nrg, *prg;
prg = list_prev_entry(rg, link);
if (&prg->link != &resv->regions && prg->to == rg->from &&