Commit a723df3d authored by Wolfram Sang's avatar Wolfram Sang Committed by Jonathan Cameron

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent ae2c9cf1
...@@ -65,7 +65,7 @@ static int asus_acpi_get_sensor_info(struct acpi_device *adev, ...@@ -65,7 +65,7 @@ static int asus_acpi_get_sensor_info(struct acpi_device *adev,
sub_elem = &elem->package.elements[j]; sub_elem = &elem->package.elements[j];
if (sub_elem->type == ACPI_TYPE_STRING) if (sub_elem->type == ACPI_TYPE_STRING)
strlcpy(info->type, sub_elem->string.pointer, strscpy(info->type, sub_elem->string.pointer,
sizeof(info->type)); sizeof(info->type));
else if (sub_elem->type == ACPI_TYPE_INTEGER) { else if (sub_elem->type == ACPI_TYPE_INTEGER) {
if (sub_elem->integer.value != client->addr) { if (sub_elem->integer.value != client->addr) {
...@@ -158,7 +158,7 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client) ...@@ -158,7 +158,7 @@ int inv_mpu_acpi_create_mux_client(struct i2c_client *client)
char *name; char *name;
info.addr = secondary; info.addr = secondary;
strlcpy(info.type, dev_name(&adev->dev), strscpy(info.type, dev_name(&adev->dev),
sizeof(info.type)); sizeof(info.type));
name = strchr(info.type, ':'); name = strchr(info.type, ':');
if (name) if (name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment