mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-19 14:56:21 +00:00
platform/x86: serial-multi-instantiate: Use 2-argument strscpy()
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 <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240602090244.1666360-5-andy.shevchenko@gmail.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
914d906aec
commit
9a3291e930
@ -131,7 +131,7 @@ static int smi_spi_probe(struct platform_device *pdev, struct smi *smi,
|
||||
|
||||
ctlr = spi_dev->controller;
|
||||
|
||||
strscpy(spi_dev->modalias, inst_array[i].type, sizeof(spi_dev->modalias));
|
||||
strscpy(spi_dev->modalias, inst_array[i].type);
|
||||
|
||||
ret = smi_get_irq(pdev, adev, &inst_array[i]);
|
||||
if (ret < 0) {
|
||||
@ -205,7 +205,7 @@ static int smi_i2c_probe(struct platform_device *pdev, struct smi *smi,
|
||||
|
||||
for (i = 0; i < count && inst_array[i].type; i++) {
|
||||
memset(&board_info, 0, sizeof(board_info));
|
||||
strscpy(board_info.type, inst_array[i].type, I2C_NAME_SIZE);
|
||||
strscpy(board_info.type, inst_array[i].type);
|
||||
snprintf(name, sizeof(name), "%s-%s.%d", dev_name(dev), inst_array[i].type, i);
|
||||
board_info.dev_name = name;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user