[PATCH v1 5/5] driver core: Use 2-argument strscpy()

Andy Shevchenko
2024-08-21T15:48:48Z

From: Andy Shevchenko <andy.shevchenko@gmail.com>

Use 2-argument strscpy(), which is not only shorter but also provides
an additional check that destination buffer is an array.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/base/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 1e5d7f9bc4f4..2a31dc0ed21b 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -4867,7 +4867,7 @@ set_dev_info(const struct device *dev, struct dev_printk_info *dev_info)
else
return;

- strscpy(dev_info->subsystem, subsys, sizeof(dev_info->subsystem));
+ strscpy(dev_info->subsystem, subsys);

/*
* Add device identifier DEVICE=:
--
2.43.0.rc1.1336.g36b5255a03ac