diff mbox series

[v2,2/4] hwmon: (sch56xx-common) Use strscpy

Message ID 20210508131457.12780-3-W_Armin@gmx.de (mailing list archive)
State Accepted
Headers show
Series hwmon: (sch56xx) Use devres for watchdog and platform_device_register_simple() | expand

Commit Message

Armin Wolf May 8, 2021, 1:14 p.m. UTC
From: Armin Wolf <W_Armin@gmx.de>

strlcpy is considered deprecated.
Replace it with strscpy.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
 drivers/hwmon/sch56xx-common.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--
2.20.1

Comments

Guenter Roeck May 10, 2021, 3:35 p.m. UTC | #1
On Sat, May 08, 2021 at 03:14:55PM +0200, W_Armin@gmx.de wrote:
> From: Armin Wolf <W_Armin@gmx.de>
> 
> strlcpy is considered deprecated.
> Replace it with strscpy.
> 
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>

Applied.

Thanks,
Guenter
diff mbox series

Patch

diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c
index 2db3456ba6f1..0b3250fc57b8 100644
--- a/drivers/hwmon/sch56xx-common.c
+++ b/drivers/hwmon/sch56xx-common.c
@@ -408,8 +408,7 @@  void sch56xx_watchdog_register(struct device *parent, u16 addr, u32 revision,
 	data->addr = addr;
 	data->io_lock = io_lock;

-	strlcpy(data->wdinfo.identity, "sch56xx watchdog",
-		sizeof(data->wdinfo.identity));
+	strscpy(data->wdinfo.identity, "sch56xx watchdog", sizeof(data->wdinfo.identity));
 	data->wdinfo.firmware_version = revision;
 	data->wdinfo.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT;
 	if (!nowayout)