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: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20220818210014.6769-1-wsa+renesas@sang-engineering.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Wolfram Sang
2022-09-19 06:17:05 -07:00
committed by Guenter Roeck
parent eb12f54876
commit f2f394db4b
56 changed files with 63 additions and 63 deletions
+1 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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;
}
+1 -1
View File
@@ -985,7 +985,7 @@ static int adm1031_detect(struct i2c_client *client,
return -ENODEV;
name = (id == 0x30) ? "adm1030" : "adm1031";
strlcpy(info->type, name, I2C_NAME_SIZE);
strscpy(info->type, name, I2C_NAME_SIZE);
return 0;
}
+1 -1
View File
@@ -590,7 +590,7 @@ static int adt7411_detect(struct i2c_client *client,
return -ENODEV;
}
strlcpy(info->type, "adt7411", I2C_NAME_SIZE);
strscpy(info->type, "adt7411", I2C_NAME_SIZE);
return 0;
}
+1 -1
View File
@@ -1782,7 +1782,7 @@ static int adt7462_detect(struct i2c_client *client,
if (revision != ADT7462_REVISION)
return -ENODEV;
strlcpy(info->type, "adt7462", I2C_NAME_SIZE);
strscpy(info->type, "adt7462", I2C_NAME_SIZE);
return 0;
}
+1 -1
View File
@@ -1342,7 +1342,7 @@ static int adt7475_detect(struct i2c_client *client,
return -ENODEV;
}
strlcpy(info->type, name, I2C_NAME_SIZE);
strscpy(info->type, name, I2C_NAME_SIZE);
return 0;
}
+1 -1
View File
@@ -809,7 +809,7 @@ static int amc6821_detect(
}
dev_info(&adapter->dev, "amc6821: chip found at 0x%02x.\n", address);
strlcpy(info->type, "amc6821", I2C_NAME_SIZE);
strscpy(info->type, "amc6821", I2C_NAME_SIZE);
return 0;
}
+1 -1
View File
@@ -769,7 +769,7 @@ static int asb100_detect(struct i2c_client *client,
if (val1 != 0x31 || val2 != 0x06)
return -ENODEV;
strlcpy(info->type, "asb100", I2C_NAME_SIZE);
strscpy(info->type, "asb100", I2C_NAME_SIZE);
return 0;
}
+1 -1
View File
@@ -1153,7 +1153,7 @@ static int asc7621_detect(struct i2c_client *client,
if (company == asc7621_chips[chip_index].company_id &&
verstep == asc7621_chips[chip_index].verstep_id) {
strlcpy(info->type, asc7621_chips[chip_index].name,
strscpy(info->type, asc7621_chips[chip_index].name,
I2C_NAME_SIZE);
dev_info(&adapter->dev, "Matched %s at 0x%02x\n",
+1 -1
View File
@@ -2456,7 +2456,7 @@ static int dme1737_i2c_detect(struct i2c_client *client,
dev_info(dev, "Found a %s chip at 0x%02x (rev 0x%02x).\n",
verstep == SCH5027_VERSTEP ? "SCH5027" : "DME1737",
client->addr, verstep);
strlcpy(info->type, name, I2C_NAME_SIZE);
strscpy(info->type, name, I2C_NAME_SIZE);
return 0;
}
+6 -6
View File
@@ -329,22 +329,22 @@ static int emc1403_detect(struct i2c_client *client,
id = i2c_smbus_read_byte_data(client, THERMAL_PID_REG);
switch (id) {
case 0x20:
strlcpy(info->type, "emc1402", I2C_NAME_SIZE);
strscpy(info->type, "emc1402", I2C_NAME_SIZE);
break;
case 0x21:
strlcpy(info->type, "emc1403", I2C_NAME_SIZE);
strscpy(info->type, "emc1403", I2C_NAME_SIZE);
break;
case 0x22:
strlcpy(info->type, "emc1422", I2C_NAME_SIZE);
strscpy(info->type, "emc1422", I2C_NAME_SIZE);
break;
case 0x23:
strlcpy(info->type, "emc1423", I2C_NAME_SIZE);
strscpy(info->type, "emc1423", I2C_NAME_SIZE);
break;
case 0x25:
strlcpy(info->type, "emc1404", I2C_NAME_SIZE);
strscpy(info->type, "emc1404", I2C_NAME_SIZE);
break;
case 0x27:
strlcpy(info->type, "emc1424", I2C_NAME_SIZE);
strscpy(info->type, "emc1424", I2C_NAME_SIZE);
break;
default:
return -ENODEV;
+1 -1
View File
@@ -643,7 +643,7 @@ emc2103_detect(struct i2c_client *new_client, struct i2c_board_info *info)
if ((product != 0x24) && (product != 0x26))
return -ENODEV;
strlcpy(info->type, "emc2103", I2C_NAME_SIZE);
strscpy(info->type, "emc2103", I2C_NAME_SIZE);
return 0;
}
+1 -1
View File
@@ -439,7 +439,7 @@ static int emc6w201_detect(struct i2c_client *client,
return -ENODEV;
}
strlcpy(info->type, "emc6w201", I2C_NAME_SIZE);
strscpy(info->type, "emc6w201", I2C_NAME_SIZE);
return 0;
}
+1 -1
View File
@@ -897,7 +897,7 @@ static int f75375_detect(struct i2c_client *client,
version = f75375_read8(client, F75375_REG_VERSION);
dev_info(&adapter->dev, "found %s version: %02X\n", name, version);
strlcpy(info->type, name, I2C_NAME_SIZE);
strscpy(info->type, name, I2C_NAME_SIZE);
return 0;
}
+1 -1
View File
@@ -1075,7 +1075,7 @@ static int fschmd_detect(struct i2c_client *client,
else
return -ENODEV;
strlcpy(info->type, fschmd_id[kind].name, I2C_NAME_SIZE);
strscpy(info->type, fschmd_id[kind].name, I2C_NAME_SIZE);
return 0;
}
+1 -1
View File
@@ -739,7 +739,7 @@ static int fts_detect(struct i2c_client *client,
if (val != 0x11)
return -ENODEV;
strlcpy(info->type, fts_id[0].name, I2C_NAME_SIZE);
strscpy(info->type, fts_id[0].name, I2C_NAME_SIZE);
info->flags = 0;
return 0;
}
+1 -1
View File
@@ -586,7 +586,7 @@ static int gl518_detect(struct i2c_client *client, struct i2c_board_info *info)
if (rev != 0x00 && rev != 0x80)
return -ENODEV;
strlcpy(info->type, "gl518sm", I2C_NAME_SIZE);
strscpy(info->type, "gl518sm", I2C_NAME_SIZE);
return 0;
}

Some files were not shown because too many files have changed in this diff Show More