Commit f2f394db authored by Wolfram Sang's avatar Wolfram Sang Committed by Guenter Roeck
Browse files

hwmon: 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>
Link: https://lore.kernel.org/r/20220818210014.6769-1-wsa+renesas@sang-engineering.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent eb12f548
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -384,7 +384,7 @@ static int adc128_detect(struct i2c_client *client, struct i2c_board_info *info)
	if (i2c_smbus_read_byte_data(client, ADC128_REG_BUSY_STATUS) & 0xfc)
		return -ENODEV;

	strlcpy(info->type, "adc128d818", I2C_NAME_SIZE);
	strscpy(info->type, "adc128d818", I2C_NAME_SIZE);

	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -426,7 +426,7 @@ static int adm1021_detect(struct i2c_client *client,

	pr_debug("Detected chip %s at adapter %d, address 0x%02x.\n",
		 type_name, i2c_adapter_id(adapter), client->addr);
	strlcpy(info->type, type_name, I2C_NAME_SIZE);
	strscpy(info->type, type_name, I2C_NAME_SIZE);

	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -470,7 +470,7 @@ static int adm1025_detect(struct i2c_client *client,
	else
		return -ENODEV;

	strlcpy(info->type, name, I2C_NAME_SIZE);
	strscpy(info->type, name, I2C_NAME_SIZE);

	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -1610,7 +1610,7 @@ static int adm1026_detect(struct i2c_client *client,
		return -ENODEV;
	}

	strlcpy(info->type, "adm1026", I2C_NAME_SIZE);
	strscpy(info->type, "adm1026", I2C_NAME_SIZE);

	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -329,7 +329,7 @@ static int adm1029_detect(struct i2c_client *client,
		return -ENODEV;
	}

	strlcpy(info->type, "adm1029", I2C_NAME_SIZE);
	strscpy(info->type, "adm1029", I2C_NAME_SIZE);

	return 0;
}
Loading