From: Thorsten Blum Date: Mon, 30 Jun 2025 17:18:26 +0000 (+0200) Subject: mm/hugetlb: use str_plural() in report_hugepages() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a83529026c23fc7d8bbf544c6c8d52df7cb9d93;p=thirdparty%2Fkernel%2Flinux.git mm/hugetlb: use str_plural() in report_hugepages() Use the string choice helper function str_plural() to simplify the code and to fix the following Coccinelle/coccicheck warning reported by string_choices.cocci: opportunity for str_plural(nrinvalid) Link: https://lkml.kernel.org/r/20250630171826.114008-2-thorsten.blum@linux.dev Signed-off-by: Thorsten Blum Acked-by: David Hildenbrand Acked-by: Oscar Salvador Reviewed-by: Dev Jain Reviewed-by: Anshuman Khandual Cc: Muchun Song Signed-off-by: Andrew Morton --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 11d5668ff6e7b..db53ead8ac434 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -3722,7 +3723,7 @@ static void __init report_hugepages(void) buf, h->nr_huge_pages); if (nrinvalid) pr_info("HugeTLB: %s page size: %lu invalid page%s discarded\n", - buf, nrinvalid, nrinvalid > 1 ? "s" : ""); + buf, nrinvalid, str_plural(nrinvalid)); pr_info("HugeTLB: %d KiB vmemmap can be freed for a %s page\n", hugetlb_vmemmap_optimizable_size(h) / SZ_1K, buf); }