From: Oscar Salvador <osalvador@suse.de>
To: akpm@linux-foundation.org
Cc: mike.kravetz@oracle.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Oscar Salvador <osalvador@suse.de>
Subject: [PATCH] mm,hugetlb: Remove unneded initialization
Date: Thu, 19 Nov 2020 12:21:41 +0100 [thread overview]
Message-ID: <20201119112141.6452-1-osalvador@suse.de> (raw)
hugetlb_add_hstate initializes nr_huge_pages and free_huge_pages to 0,
but since hstates[] is a global variable, all its fields are defined to
0 already.
Signed-off-by: Oscar Salvador <osalvador@suse.de>
---
mm/hugetlb.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 37f15c3c24dc..1c69e9044887 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3197,8 +3197,6 @@ void __init hugetlb_add_hstate(unsigned int order)
h = &hstates[hugetlb_max_hstate++];
h->order = order;
h->mask = ~((1ULL << (order + PAGE_SHIFT)) - 1);
- h->nr_huge_pages = 0;
- h->free_huge_pages = 0;
for (i = 0; i < MAX_NUMNODES; ++i)
INIT_LIST_HEAD(&h->hugepage_freelists[i]);
INIT_LIST_HEAD(&h->hugepage_activelist);
--
2.26.2
next reply other threads:[~2020-11-19 11:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-19 11:21 Oscar Salvador [this message]
2020-11-19 18:28 ` [PATCH] mm,hugetlb: Remove unneded initialization Mike Kravetz
2020-11-20 9:28 ` David Hildenbrand
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=20201119112141.6452-1-osalvador@suse.de \
--to=osalvador@suse.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.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;
as well as URLs for NNTP newsgroup(s).