From: Arnd Bergmann Date: Fri, 11 Jul 2025 07:27:09 +0000 (+0200) Subject: platform/x86/intel/pmt/discovery: fix format string warning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6382c27389c266e90b31151a79d81fa6e122d2d6;p=thirdparty%2Flinux.git platform/x86/intel/pmt/discovery: fix format string warning When -Wformat-security is enabled, this new code triggers it: drivers/platform/x86/intel/pmt/discovery.c: In function 'pmt_features_discovery': drivers/platform/x86/intel/pmt/discovery.c:505:36: error: format not a string literal and no format arguments [-Werror=format-security] 505 | pmt_feature_names[feature->id]); Fixes: d9a078809356 ("platform/x86/intel/pmt: Add PMT Discovery driver") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20250711072718.2748415-1-arnd@kernel.org Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen --- diff --git a/drivers/platform/x86/intel/pmt/discovery.c b/drivers/platform/x86/intel/pmt/discovery.c index 1a680a042a98e..32713a194a550 100644 --- a/drivers/platform/x86/intel/pmt/discovery.c +++ b/drivers/platform/x86/intel/pmt/discovery.c @@ -502,7 +502,7 @@ static int pmt_features_discovery(struct pmt_features_priv *priv, } ret = kobject_init_and_add(&feature->kobj, ktype, &priv->dev->kobj, - pmt_feature_names[feature->id]); + "%s", pmt_feature_names[feature->id]); if (ret) return ret;