* + mm-hugetlb-use-sizeofbuf-in-string_get_size-calls.patch added to mm-unstable branch
@ 2026-10-14 3:33 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-14 3:33 UTC (permalink / raw)
To: mm-commits, osalvador, muchun.song, david, lienze, akpm
The patch titled
Subject: mm/hugetlb: use sizeof(buf) in string_get_size() calls
has been added to the -mm mm-unstable branch. Its filename is
mm-hugetlb-use-sizeofbuf-in-string_get_size-calls.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-hugetlb-use-sizeofbuf-in-string_get_size-calls.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days
------------------------------------------------------
From: Enze Li <lienze@kylinos.cn>
Subject: mm/hugetlb: use sizeof(buf) in string_get_size() calls
Date: Wed, 14 Oct 2026 11:11:47 +0800
Replace the hardcoded 32 with sizeof(buf) at the remaining four call
sites, for consistency with the rest of the file.
Link: https://lore.kernel.org/20261014031147.444733-1-lienze@kylinos.cn
Signed-off-by: Enze Li <lienze@kylinos.cn>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: David Hildenbrand <david@kernel.org>
---
mm/hugetlb.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/mm/hugetlb.c~mm-hugetlb-use-sizeofbuf-in-string_get_size-calls
+++ a/mm/hugetlb.c
@@ -3466,7 +3466,7 @@ static void __init hugetlb_hstate_alloc_
if (i == h->max_huge_pages_node[nid])
return;
- string_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, 32);
+ string_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, sizeof(buf));
pr_warn("allocating %u of page size %s failed node%d. Only allocated %lu hugepages.\n",
h->max_huge_pages_node[nid], buf, nid, i);
h->max_huge_pages -= (h->max_huge_pages_node[nid] - i);
@@ -3493,7 +3493,7 @@ static void __init hugetlb_hstate_alloc_
if (allocated < h->max_huge_pages) {
char buf[32];
- string_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, 32);
+ string_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, sizeof(buf));
pr_warn("allocating %lu of page size %s failed. Only allocated %lu hugepages.\n",
h->max_huge_pages, buf, allocated);
h->max_huge_pages = allocated;
@@ -3704,7 +3704,7 @@ static void __init report_hugepages(void
for_each_hstate(h) {
char buf[32];
- string_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, 32);
+ string_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, sizeof(buf));
pr_info("registered %s page size, pre-allocated %ld pages\n",
buf, h->nr_huge_pages);
pr_info("%d KiB vmemmap can be freed for a %s page\n",
@@ -4216,7 +4216,7 @@ static int __init hugetlb_init(void)
char buf[32];
string_get_size(huge_page_size(&default_hstate),
- 1, STRING_UNITS_2, buf, 32);
+ 1, STRING_UNITS_2, buf, sizeof(buf));
pr_warn("Ignoring hugepages=%lu associated with %s page size\n",
default_hstate.max_huge_pages, buf);
pr_warn("Using hugepages=%lu for number of default huge pages\n",
_
Patches currently in -mm which might be from lienze@kylinos.cn are
maintainers-cover-all-hugetlb-headers-under-hugetlb-subsystem.patch
mm-hugetlb_cgroup-add-trailing-endif-comment-for-include-guard.patch
docs-hugetlbpagerst-fix-typo-in-per-node-attribute-description.patch
mm-hugetlb-prefix-log-messages-via-pr_fmt.patch
mm-hugetlb-move-hugetlb_sysfs_initialized-into-hugetlb_register_all_nodes.patch
mm-hugetlb-use-sizeofbuf-in-string_get_size-calls.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-14 3:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-14 3:33 + mm-hugetlb-use-sizeofbuf-in-string_get_size-calls.patch added to mm-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.