mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/x86/intel/pmt/discovery: fix format string warning
@ 2025-07-11  7:27 Arnd Bergmann
  2025-07-11 15:30 ` Ilpo Järvinen
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2025-07-11  7:27 UTC (permalink / raw)
  To: David E. Box, Hans de Goede, Ilpo Järvinen
  Cc: Arnd Bergmann, Nathan Chancellor, platform-driver-x86, linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86/intel/pmt/discovery: fix format string warning
  2025-07-11  7:27 [PATCH] platform/x86/intel/pmt/discovery: fix format string warning Arnd Bergmann
@ 2025-07-11 15:30 ` Ilpo Järvinen
  0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2025-07-11 15:30 UTC (permalink / raw)
  To: David E. Box, Hans de Goede, Arnd Bergmann
  Cc: Arnd Bergmann, Nathan Chancellor, platform-driver-x86, linux-kernel

On Fri, 11 Jul 2025 09:27:09 +0200, Arnd Bergmann wrote:

> 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]);
> 
> 
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86/intel/pmt/discovery: fix format string warning
      commit: 6382c27389c266e90b31151a79d81fa6e122d2d6

--
 i.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-11 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-11  7:27 [PATCH] platform/x86/intel/pmt/discovery: fix format string warning Arnd Bergmann
2025-07-11 15:30 ` Ilpo Järvinen

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®