[PATCH v5 17/20] platform/x86/intel/tpmi: Use scnprintf() to build the debugfs names
From: Kuppuswamy Sathyanarayanan
Date: Tue Oct 13 2026 - 15:45:03 EST
The kernel has both snprintf() and scnprintf() for formatting into a
fixed size buffer. The preference is to settle on scnprintf() and stop
adding snprintf() users, so that only one of the two remains in use.
Convert the two callers in tpmi_dbgfs_register(). Neither of them looks
at the return value, so the difference in what the two functions return
does not matter here.
No functional change intended.
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx>
---
drivers/platform/x86/intel/tpmi_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/intel/tpmi_common.c b/drivers/platform/x86/intel/tpmi_common.c
index b4d361f0ec44..097754365897 100644
--- a/drivers/platform/x86/intel/tpmi_common.c
+++ b/drivers/platform/x86/intel/tpmi_common.c
@@ -492,7 +492,7 @@ static void tpmi_dbgfs_register(struct intel_tpmi_info *tpmi_info)
char name[64];
int i;
- snprintf(name, sizeof(name), "tpmi-%s", dev_name(tpmi_info->parent));
+ scnprintf(name, sizeof(name), "tpmi-%s", dev_name(tpmi_info->parent));
tpmi_info->dbgfs_dir = debugfs_create_dir(name, NULL);
debugfs_create_file("pfs_dump", 0444, tpmi_info->dbgfs_dir, tpmi_info, &tpmi_pfs_dbg_fops);
@@ -502,7 +502,7 @@ static void tpmi_dbgfs_register(struct intel_tpmi_info *tpmi_info)
struct dentry *dir;
pfs = &tpmi_info->tpmi_features[i];
- snprintf(name, sizeof(name), "tpmi-id-%02x", pfs->pfs_header.tpmi_id);
+ scnprintf(name, sizeof(name), "tpmi-id-%02x", pfs->pfs_header.tpmi_id);
dir = debugfs_create_dir(name, tpmi_info->dbgfs_dir);
debugfs_create_file("mem_dump", 0444, dir, pfs, &tpmi_mem_dump_fops);
--
2.43.0