Skip to content

Commit ea1558c

Browse files
Wolfram Sangwsakernel
authored andcommitted
i2c: move drivers from strlcpy to strscpy
Follow the advice of the below link and prefer 'strscpy'. Conversion is easy because no driver used the return value and has been done with a simple sed invocation. 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: Wolfram Sang <wsa@kernel.org>
1 parent 663bb7b commit ea1558c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+49
-49
lines changed

drivers/i2c/busses/i2c-altera.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ static int altr_i2c_probe(struct platform_device *pdev)
447447
mutex_unlock(&idev->isr_mutex);
448448

449449
i2c_set_adapdata(&idev->adapter, idev);
450-
strlcpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
450+
strscpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
451451
idev->adapter.owner = THIS_MODULE;
452452
idev->adapter.algo = &altr_i2c_algo;
453453
idev->adapter.dev.parent = &pdev->dev;

drivers/i2c/busses/i2c-aspeed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
10221022
bus->adap.algo = &aspeed_i2c_algo;
10231023
bus->adap.dev.parent = &pdev->dev;
10241024
bus->adap.dev.of_node = pdev->dev.of_node;
1025-
strlcpy(bus->adap.name, pdev->name, sizeof(bus->adap.name));
1025+
strscpy(bus->adap.name, pdev->name, sizeof(bus->adap.name));
10261026
i2c_set_adapdata(&bus->adap, bus);
10271027

10281028
bus->dev = &pdev->dev;

drivers/i2c/busses/i2c-au1550.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ i2c_au1550_probe(struct platform_device *pdev)
321321
priv->adap.algo = &au1550_algo;
322322
priv->adap.algo_data = priv;
323323
priv->adap.dev.parent = &pdev->dev;
324-
strlcpy(priv->adap.name, "Au1xxx PSC I2C", sizeof(priv->adap.name));
324+
strscpy(priv->adap.name, "Au1xxx PSC I2C", sizeof(priv->adap.name));
325325

326326
/* Now, set up the PSC for SMBus PIO mode. */
327327
i2c_au1550_setup(priv);

drivers/i2c/busses/i2c-axxia.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ static int axxia_i2c_probe(struct platform_device *pdev)
783783
}
784784

785785
i2c_set_adapdata(&idev->adapter, idev);
786-
strlcpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
786+
strscpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
787787
idev->adapter.owner = THIS_MODULE;
788788
idev->adapter.algo = &axxia_i2c_algo;
789789
idev->adapter.bus_recovery_info = &axxia_i2c_recovery_info;

drivers/i2c/busses/i2c-bcm-kona.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ static int bcm_kona_i2c_probe(struct platform_device *pdev)
839839
adap = &dev->adapter;
840840
i2c_set_adapdata(adap, dev);
841841
adap->owner = THIS_MODULE;
842-
strlcpy(adap->name, "Broadcom I2C adapter", sizeof(adap->name));
842+
strscpy(adap->name, "Broadcom I2C adapter", sizeof(adap->name));
843843
adap->algo = &bcm_algo;
844844
adap->dev.parent = &pdev->dev;
845845
adap->dev.of_node = pdev->dev.of_node;

drivers/i2c/busses/i2c-brcmstb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
674674
adap = &dev->adapter;
675675
i2c_set_adapdata(adap, dev);
676676
adap->owner = THIS_MODULE;
677-
strlcpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
677+
strscpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
678678
adap->algo = &brcmstb_i2c_algo;
679679
adap->dev.parent = &pdev->dev;
680680
adap->dev.of_node = pdev->dev.of_node;

drivers/i2c/busses/i2c-cbus-gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static int cbus_i2c_probe(struct platform_device *pdev)
245245
adapter->nr = pdev->id;
246246
adapter->timeout = HZ;
247247
adapter->algo = &cbus_i2c_algo;
248-
strlcpy(adapter->name, "CBUS I2C adapter", sizeof(adapter->name));
248+
strscpy(adapter->name, "CBUS I2C adapter", sizeof(adapter->name));
249249

250250
spin_lock_init(&chost->lock);
251251
chost->dev = &pdev->dev;

drivers/i2c/busses/i2c-cht-wc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev)
404404
adap->adapter.class = I2C_CLASS_HWMON;
405405
adap->adapter.algo = &cht_wc_i2c_adap_algo;
406406
adap->adapter.lock_ops = &cht_wc_i2c_adap_lock_ops;
407-
strlcpy(adap->adapter.name, "PMIC I2C Adapter",
407+
strscpy(adap->adapter.name, "PMIC I2C Adapter",
408408
sizeof(adap->adapter.name));
409409
adap->adapter.dev.parent = &pdev->dev;
410410

drivers/i2c/busses/i2c-cros-ec-tunnel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ static int ec_i2c_probe(struct platform_device *pdev)
267267
bus->dev = dev;
268268

269269
bus->adap.owner = THIS_MODULE;
270-
strlcpy(bus->adap.name, "cros-ec-i2c-tunnel", sizeof(bus->adap.name));
270+
strscpy(bus->adap.name, "cros-ec-i2c-tunnel", sizeof(bus->adap.name));
271271
bus->adap.algo = &ec_i2c_algorithm;
272272
bus->adap.algo_data = bus;
273273
bus->adap.dev.parent = &pdev->dev;

drivers/i2c/busses/i2c-davinci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
845845
i2c_set_adapdata(adap, dev);
846846
adap->owner = THIS_MODULE;
847847
adap->class = I2C_CLASS_DEPRECATED;
848-
strlcpy(adap->name, "DaVinci I2C adapter", sizeof(adap->name));
848+
strscpy(adap->name, "DaVinci I2C adapter", sizeof(adap->name));
849849
adap->algo = &i2c_davinci_algo;
850850
adap->dev.parent = &pdev->dev;
851851
adap->timeout = DAVINCI_I2C_TIMEOUT;

0 commit comments

Comments
 (0)