summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>2026-10-13 12:29:32 -0700
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-10-15 16:53:51 +0300
commit596ce7f0d6fdd6426e331d7817fad9ef02bbeb72 (patch)
treeaa162b2e8d24264555f1a44843ceab6ede71f3f4
parent769236d3c2265c942ca69b567b21dfcf6439eddd (diff)
downloadlinux-596ce7f0d6fdd6426e331d7817fad9ef02bbeb72.tar.gz
linux-596ce7f0d6fdd6426e331d7817fad9ef02bbeb72.zip
platform/x86/intel/tpmi: Use scnprintf() to build the debugfs names
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@linux.intel.com> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Link: https://patch.msgid.link/20261013192935.2243291-18-sathyanarayanan.kuppuswamy@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-rw-r--r--drivers/platform/x86/intel/tpmi_common.c4
1 files 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);