diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2022-08-18 23:00:53 +0200 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2022-08-22 22:01:26 +0200 |
commit | 7a12dd077e5207d72fadaabf7d4520bd3af84082 (patch) | |
tree | 07195a1805827c9338484b817cfec682346ba152 /drivers/of/unittest.c | |
parent | dt-bindings: arm,versatile-sysreg: Convert to DT schema format (diff) | |
download | linux-7a12dd077e5207d72fadaabf7d4520bd3af84082.tar.xz linux-7a12dd077e5207d72fadaabf7d4520bd3af84082.zip |
of: 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>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220818210054.7157-1-wsa+renesas@sang-engineering.com
Diffstat (limited to '')
-rw-r--r-- | drivers/of/unittest.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index eafa8ffefbd0..6fa14b77086a 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -2465,7 +2465,7 @@ static int unittest_i2c_bus_probe(struct platform_device *pdev) adap = &std->adap; i2c_set_adapdata(adap, std); adap->nr = -1; - strlcpy(adap->name, pdev->name, sizeof(adap->name)); + strscpy(adap->name, pdev->name, sizeof(adap->name)); adap->class = I2C_CLASS_DEPRECATED; adap->algo = &unittest_i2c_algo; adap->dev.parent = dev; |