]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pinctrl: cy8c95x0: Use 2-argument strscpy()
authorAndy Shevchenko <andy.shevchenko@gmail.com>
Sun, 10 Nov 2024 20:59:41 +0000 (22:59 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 13 Nov 2024 13:18:06 +0000 (14:18 +0100)
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 <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/20241110210040.18918-2-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-cy8c95x0.c

index 5096ccdd459ea40c0a7ec9e1a2af7969dc31f970..5f533dff44173e446bd0d3214884078fc55bcaba 100644 (file)
@@ -1424,7 +1424,7 @@ static int cy8c95x0_detect(struct i2c_client *client,
        }
 
        dev_info(&client->dev, "Found a %s chip at 0x%02x.\n", name, client->addr);
-       strscpy(info->type, name, I2C_NAME_SIZE);
+       strscpy(info->type, name);
 
        return 0;
 }
@@ -1457,15 +1457,15 @@ static int cy8c95x0_probe(struct i2c_client *client)
 
        switch (chip->tpin) {
        case 20:
-               strscpy(chip->name, cy8c95x0_id[0].name, I2C_NAME_SIZE);
+               strscpy(chip->name, cy8c95x0_id[0].name);
                regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 3 * MUXED_STRIDE;
                break;
        case 40:
-               strscpy(chip->name, cy8c95x0_id[1].name, I2C_NAME_SIZE);
+               strscpy(chip->name, cy8c95x0_id[1].name);
                regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 6 * MUXED_STRIDE;
                break;
        case 60:
-               strscpy(chip->name, cy8c95x0_id[2].name, I2C_NAME_SIZE);
+               strscpy(chip->name, cy8c95x0_id[2].name);
                regmap_range_conf.range_max = CY8C95X0_VIRTUAL + 8 * MUXED_STRIDE;
                break;
        default: