public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] ACPI: processor: idle: Replace strlcat() with better alternative
@ 2026-03-16 17:01 Andy Shevchenko
  2026-03-16 18:43 ` Josh Law
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Andy Shevchenko @ 2026-03-16 17:01 UTC (permalink / raw)
  To: Rafael J. Wysocki, linux-acpi, linux-kernel
  Cc: Rafael J. Wysocki, Len Brown, Josh Law, kees, linux-hardening,
	Andy Shevchenko

strlcpy() and strlcat() are confusing APIs and the former one already gone
from the kernel. In preparation to kill strlcat() replace it with the better
alternative.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/processor_idle.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 45b5d17443cf..498d88f5d5c9 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1010,9 +1010,7 @@ static bool combine_lpi_states(struct acpi_lpi_state *local,
 	result->arch_flags = parent->arch_flags;
 	result->index = parent->index;
 
-	strscpy(result->desc, local->desc, ACPI_CX_DESC_LEN);
-	strlcat(result->desc, "+", ACPI_CX_DESC_LEN);
-	strlcat(result->desc, parent->desc, ACPI_CX_DESC_LEN);
+	snprintf(result->desc, ACPI_CX_DESC_LEN, "%s+%s", local->desc, parent->desc);
 	return true;
 }
 
-- 
2.50.1


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

end of thread, other threads:[~2026-03-20 19:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16 17:01 [PATCH v1 1/1] ACPI: processor: idle: Replace strlcat() with better alternative Andy Shevchenko
2026-03-16 18:43 ` Josh Law
2026-03-16 18:47   ` Andy Shevchenko
2026-03-16 18:49     ` Josh Law
2026-03-16 19:42       ` Andy Shevchenko
2026-03-16 19:51         ` Josh Law
2026-03-17  8:17 ` kernel test robot
2026-03-17  8:29   ` Andy Shevchenko
2026-03-20 19:17 ` Kees Cook
2026-03-20 19:25   ` Andy Shevchenko
2026-03-20 19:26     ` Kees Cook
2026-03-20 19:31     ` Josh Law
2026-03-20 19:39       ` Andy Shevchenko
2026-03-20 19:34     ` Kees Cook
2026-03-20 19:39       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox