Skip to content

Commit b7e9fc3

Browse files
andy-shevlinusw
authored andcommitted
pinctrl: cy8c95x0: 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 <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent a53643f commit b7e9fc3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/pinctrl/pinctrl-cy8c95x0.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ static int cy8c95x0_detect(struct i2c_client *client,
14241424
}
14251425

14261426
dev_info(&client->dev, "Found a %s chip at 0x%02x.\n", name, client->addr);
1427-
strscpy(info->type, name, I2C_NAME_SIZE);
1427+
strscpy(info->type, name);
14281428

14291429
return 0;
14301430
}
@@ -1457,15 +1457,15 @@ static int cy8c95x0_probe(struct i2c_client *client)
14571457

14581458
switch (chip->tpin) {
14591459
case 20:
1460-
strscpy(chip->name, cy8c95x0_id[0].name, I2C_NAME_SIZE);
1460+
strscpy(chip->name, cy8c95x0_id[0].name);
14611461
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 3 * MUXED_STRIDE;
14621462
break;
14631463
case 40:
1464-
strscpy(chip->name, cy8c95x0_id[1].name, I2C_NAME_SIZE);
1464+
strscpy(chip->name, cy8c95x0_id[1].name);
14651465
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 6 * MUXED_STRIDE;
14661466
break;
14671467
case 60:
1468-
strscpy(chip->name, cy8c95x0_id[2].name, I2C_NAME_SIZE);
1468+
strscpy(chip->name, cy8c95x0_id[2].name);
14691469
regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 8 * MUXED_STRIDE;
14701470
break;
14711471
default:

0 commit comments

Comments
 (0)