[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251222072359.3626182-1-xiujianfeng@huaweicloud.com>
Date: Mon, 22 Dec 2025 07:23:59 +0000
From: Xiu Jianfeng <xiujianfeng@...weicloud.com>
To: muchun.song@...ux.dev,
osalvador@...e.de,
david@...nel.org,
akpm@...ux-foundation.org
Cc: linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: [PATCH -next] mm/hugetlb_cgroup: fix -Wformat-truncation warning
From: Xiu Jianfeng <xiujianfeng@...wei.com>
A false-positive compile warnings with -Wformat-trucation was introduced
by commit 47179fe03588 ("mm/hugetlb_cgroup: prepare cftypes based
on template") on arch s390. Suppress it by replacing snprintf() with
scnprintf().
Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202512212332.9lFRbgdS-lkp@intel.com/
Signed-off-by: Xiu Jianfeng <xiujianfeng@...wei.com>
---
mm/hugetlb_cgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index 58e895f3899a..7144d7d555eb 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -822,7 +822,7 @@ hugetlb_cgroup_cfttypes_init(struct hstate *h, struct cftype *cft,
for (i = 0; i < tmpl_size; cft++, tmpl++, i++) {
*cft = *tmpl;
/* rebuild the name */
- snprintf(cft->name, MAX_CFTYPE_NAME, "%s.%s", buf, tmpl->name);
+ scnprintf(cft->name, MAX_CFTYPE_NAME, "%s.%s", buf, tmpl->name);
/* rebuild the private */
cft->private = MEMFILE_PRIVATE(idx, tmpl->private);
/* rebuild the file_offset */
--
2.43.0
Powered by blists - more mailing lists