[PATCH 2/5] spi: lm70llp: Use strscpy() instead of strcpy()

From: Aayush Kumar

Date: Fri Oct 09 2026 - 09:44:51 EST


Use a safer function strscpy() instead of strcpy() for copying to
arrays. Only idiomatic code replacement, and no functional changes.

Signed-off-by: Aayush Kumar <code@xxxxxxxxxxx>
---
drivers/spi/spi-lm70llp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-lm70llp.c b/drivers/spi/spi-lm70llp.c
index e61e89b41..bd8028892 100644
--- a/drivers/spi/spi-lm70llp.c
+++ b/drivers/spi/spi-lm70llp.c
@@ -252,7 +252,7 @@ static void spi_lm70llp_attach(struct parport *p)
* We are binding to the generic drivers/hwmon/lm70.c device
* driver.
*/
- strcpy(pp->info.modalias, "lm70");
+ strscpy(pp->info.modalias, "lm70", sizeof(pp->info.modalias));
pp->info.max_speed_hz = 6 * 1000 * 1000;
pp->info.chip_select = 0;
pp->info.mode = SPI_3WIRE | SPI_MODE_0;
--
2.56.0