From: XU pengfei <xupengfei@nfschina.com>
To: mike.kravetz@oracle.com, songmuchun@bytedance.com,
akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
XU pengfei <xupengfei@nfschina.com>
Subject: [PATCH 1/1] mm/hugetlb: Remove unnecessary 'NULL' values from Pointer
Date: Wed, 14 Sep 2022 09:21:14 +0800 [thread overview]
Message-ID: <20220914012113.6271-1-xupengfei@nfschina.com> (raw)
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
next reply other threads:[~2022-09-14 1:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-14 1:21 XU pengfei [this message]
2022-09-14 6:52 ` Muchun Song
2022-09-15 1:19 ` XU pengfei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220914012113.6271-1-xupengfei@nfschina.com \
--to=xupengfei@nfschina.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=songmuchun@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox