]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
w1: ds28e17: Replace deprecated strcpy + strcat in w1_f19_add_slave
authorThorsten Blum <thorsten.blum@linux.dev>
Thu, 9 Oct 2025 17:45:12 +0000 (19:45 +0200)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Mon, 13 Oct 2025 00:19:03 +0000 (02:19 +0200)
strcpy() is deprecated and using strcat() is discouraged. Replace them with
scnprintf().  No functional changes.

Link: https://github.com/KSPP/linux/issues/88
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
drivers/w1/slaves/w1_ds28e17.c

index 5738cbce1a37f31edfe74c794a6b75277296bf96..e53bc41bde3ca435bbdef8c66cc7ff10b11a99bb 100644 (file)
@@ -719,8 +719,8 @@ static int w1_f19_add_slave(struct w1_slave *sl)
        data->adapter.owner      = THIS_MODULE;
        data->adapter.algo       = &w1_f19_i2c_algorithm;
        data->adapter.algo_data  = sl;
-       strcpy(data->adapter.name, "w1-");
-       strcat(data->adapter.name, sl->name);
+       scnprintf(data->adapter.name, sizeof(data->adapter.name), "w1-%s",
+                 sl->name);
        data->adapter.dev.parent = &sl->dev;
        data->adapter.quirks     = &w1_f19_i2c_adapter_quirks;