From: Arnd Bergmann <arnd@kernel.org>
To: "David E. Box" <david.e.box@linux.intel.com>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Nathan Chancellor <nathan@kernel.org>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] platform/x86/intel/pmt/discovery: fix format string warning
Date: Fri, 11 Jul 2025 09:27:09 +0200 [thread overview]
Message-ID: <20250711072718.2748415-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.de>
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 <arnd@arndb.de>
---
drivers/platform/x86/intel/pmt/discovery.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/intel/pmt/discovery.c b/drivers/platform/x86/intel/pmt/discovery.c
index 1a680a042a98..32713a194a55 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;
--
2.39.5
next reply other threads:[~2025-07-11 7:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 7:27 Arnd Bergmann [this message]
2025-07-11 15:30 ` Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250711072718.2748415-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=arnd@arndb.de \
--cc=david.e.box@linux.intel.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®