Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

w1: sgi: 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/20220818210121.7589-1-wsa+renesas@sang-engineering.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

authored by

Wolfram Sang and committed by
Krzysztof Kozlowski
5dfd3c73 388f22fe

+1 -1
+1 -1
drivers/w1/masters/sgi_w1.c
··· 93 93 94 94 pdata = dev_get_platdata(&pdev->dev); 95 95 if (pdata) { 96 - strlcpy(sdev->dev_id, pdata->dev_id, sizeof(sdev->dev_id)); 96 + strscpy(sdev->dev_id, pdata->dev_id, sizeof(sdev->dev_id)); 97 97 sdev->bus_master.dev_id = sdev->dev_id; 98 98 } 99 99