[PATCH 1/1] mm/hugetlb: Remove unnecessary 'NULL' values from Pointer

From: XU pengfei
Date: Tue Sep 13 2022 - 21:21:59 EST



Pointer variables allocate memory first, and then judge. There is no
need to initialize the assignment.

Signed-off-by: XU pengfei <xupengfei@xxxxxxxxxxxx>
---
mm/hugetlb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index e070b8593b37..a05f22b1ab1e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -257,7 +257,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);

@@ -339,7 +339,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 &&
--
2.18.2