linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] mm/hugetlb: Remove unnecessary 'NULL' values from Pointer
@ 2022-09-14  1:21 XU pengfei
  2022-09-14  6:52 ` Muchun Song
  2022-09-15  1:19 ` XU pengfei
  0 siblings, 2 replies; 3+ messages in thread
From: XU pengfei @ 2022-09-14  1:21 UTC (permalink / raw)
  To: mike.kravetz, songmuchun, akpm; +Cc: linux-mm, linux-kernel, XU pengfei


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

Signed-off-by: XU pengfei <xupengfei@nfschina.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] mm/hugetlb: Remove unnecessary 'NULL' values from Pointer
  2022-09-14  1:21 [PATCH 1/1] mm/hugetlb: Remove unnecessary 'NULL' values from Pointer XU pengfei
@ 2022-09-14  6:52 ` Muchun Song
  2022-09-15  1:19 ` XU pengfei
  1 sibling, 0 replies; 3+ messages in thread
From: Muchun Song @ 2022-09-14  6:52 UTC (permalink / raw)
  To: XU pengfei; +Cc: Mike Kravetz, Muchun Song, akpm, linux-mm, linux-kernel



> On Sep 14, 2022, at 09:21, XU pengfei <xupengfei@nfschina.com> wrote:
> 
> 
> Pointer variables allocate memory first, and then judge. There is no
> need to initialize the assignment.
> 
> Signed-off-by: XU pengfei <xupengfei@nfschina.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] mm/hugetlb: Remove unnecessary 'NULL' values from Pointer
  2022-09-14  1:21 [PATCH 1/1] mm/hugetlb: Remove unnecessary 'NULL' values from Pointer XU pengfei
  2022-09-14  6:52 ` Muchun Song
@ 2022-09-15  1:19 ` XU pengfei
  1 sibling, 0 replies; 3+ messages in thread
From: XU pengfei @ 2022-09-15  1:19 UTC (permalink / raw)
  To: xupengfei; +Cc: akpm, linux-kernel, linux-mm, mike.kravetz, songmuchun


Dear Andrew Morton:
    Thank you for including this patch.

This patch  shortly appears at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-hugetlb-remove-unnecessary-null-values-from-pointer.patch

This patch  later appears in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-15  1:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14  1:21 [PATCH 1/1] mm/hugetlb: Remove unnecessary 'NULL' values from Pointer XU pengfei
2022-09-14  6:52 ` Muchun Song
2022-09-15  1:19 ` XU pengfei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).