Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: imu: inv_mpu6050: move from strlcpy with unused retval to strscpy

Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.

Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Wolfram Sang and committed by
Jonathan Cameron
a723df3d ae2c9cf1

+2 -2
+2 -2
drivers/iio/imu/inv_mpu6050/inv_mpu_acpi.c
··· 65 65 66 66 sub_elem = &elem->package.elements[j]; 67 67 if (sub_elem->type == ACPI_TYPE_STRING) 68 - strlcpy(info->type, sub_elem->string.pointer, 68 + strscpy(info->type, sub_elem->string.pointer, 69 69 sizeof(info->type)); 70 70 else if (sub_elem->type == ACPI_TYPE_INTEGER) { 71 71 if (sub_elem->integer.value != client->addr) { ··· 158 158 char *name; 159 159 160 160 info.addr = secondary; 161 - strlcpy(info.type, dev_name(&adev->dev), 161 + strscpy(info.type, dev_name(&adev->dev), 162 162 sizeof(info.type)); 163 163 name = strchr(info.type, ':'); 164 164 if (name)