i2c: move drivers from strlcpy to strscpy
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 11 Aug 2022 07:10:30 +0000 (09:10 +0200)
committerWolfram Sang <wsa@kernel.org>
Thu, 11 Aug 2022 21:02:51 +0000 (23:02 +0200)
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>
47 files changed:
drivers/i2c/busses/i2c-altera.c
drivers/i2c/busses/i2c-aspeed.c
drivers/i2c/busses/i2c-au1550.c
drivers/i2c/busses/i2c-axxia.c
drivers/i2c/busses/i2c-bcm-kona.c
drivers/i2c/busses/i2c-brcmstb.c
drivers/i2c/busses/i2c-cbus-gpio.c
drivers/i2c/busses/i2c-cht-wc.c
drivers/i2c/busses/i2c-cros-ec-tunnel.c
drivers/i2c/busses/i2c-davinci.c
drivers/i2c/busses/i2c-digicolor.c
drivers/i2c/busses/i2c-eg20t.c
drivers/i2c/busses/i2c-emev2.c
drivers/i2c/busses/i2c-exynos5.c
drivers/i2c/busses/i2c-gpio.c
drivers/i2c/busses/i2c-highlander.c
drivers/i2c/busses/i2c-hix5hd2.c
drivers/i2c/busses/i2c-i801.c
drivers/i2c/busses/i2c-ibm_iic.c
drivers/i2c/busses/i2c-icy.c
drivers/i2c/busses/i2c-imx-lpi2c.c
drivers/i2c/busses/i2c-lpc2k.c
drivers/i2c/busses/i2c-meson.c
drivers/i2c/busses/i2c-mt65xx.c
drivers/i2c/busses/i2c-mt7621.c
drivers/i2c/busses/i2c-mv64xxx.c
drivers/i2c/busses/i2c-mxs.c
drivers/i2c/busses/i2c-nvidia-gpu.c
drivers/i2c/busses/i2c-omap.c
drivers/i2c/busses/i2c-opal.c
drivers/i2c/busses/i2c-parport.c
drivers/i2c/busses/i2c-pxa.c
drivers/i2c/busses/i2c-qcom-geni.c
drivers/i2c/busses/i2c-qup.c
drivers/i2c/busses/i2c-rcar.c
drivers/i2c/busses/i2c-riic.c
drivers/i2c/busses/i2c-rk3x.c
drivers/i2c/busses/i2c-s3c2410.c
drivers/i2c/busses/i2c-sh_mobile.c
drivers/i2c/busses/i2c-simtec.c
drivers/i2c/busses/i2c-taos-evm.c
drivers/i2c/busses/i2c-tegra-bpmp.c
drivers/i2c/busses/i2c-tegra.c
drivers/i2c/busses/i2c-uniphier-f.c
drivers/i2c/busses/i2c-uniphier.c
drivers/i2c/busses/i2c-versatile.c
drivers/i2c/busses/i2c-wmt.c

index 354cf7e45c4a095182fa679cd7139abeeaf287c8..50e7f3f670b6f0d2400ba21d8dc3bc675d67ad65 100644 (file)
@@ -447,7 +447,7 @@ static int altr_i2c_probe(struct platform_device *pdev)
        mutex_unlock(&idev->isr_mutex);
 
        i2c_set_adapdata(&idev->adapter, idev);
-       strlcpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
+       strscpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
        idev->adapter.owner = THIS_MODULE;
        idev->adapter.algo = &altr_i2c_algo;
        idev->adapter.dev.parent = &pdev->dev;
index 771e53d3d197346a56a04bb2356deb80fd7124f7..185dedfebbac9fda9093a5ce547921fc75812400 100644 (file)
@@ -1022,7 +1022,7 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)
        bus->adap.algo = &aspeed_i2c_algo;
        bus->adap.dev.parent = &pdev->dev;
        bus->adap.dev.of_node = pdev->dev.of_node;
-       strlcpy(bus->adap.name, pdev->name, sizeof(bus->adap.name));
+       strscpy(bus->adap.name, pdev->name, sizeof(bus->adap.name));
        i2c_set_adapdata(&bus->adap, bus);
 
        bus->dev = &pdev->dev;
index 22aed922552b4a7cde185b66a771fd8f25bbb843..99bd24d0e6a59e0741a744c85bda408ad2891510 100644 (file)
@@ -321,7 +321,7 @@ i2c_au1550_probe(struct platform_device *pdev)
        priv->adap.algo = &au1550_algo;
        priv->adap.algo_data = priv;
        priv->adap.dev.parent = &pdev->dev;
-       strlcpy(priv->adap.name, "Au1xxx PSC I2C", sizeof(priv->adap.name));
+       strscpy(priv->adap.name, "Au1xxx PSC I2C", sizeof(priv->adap.name));
 
        /* Now, set up the PSC for SMBus PIO mode. */
        i2c_au1550_setup(priv);
index 5294b73beca85464f3c9444e6c564eb56c60d2dd..bdf3b50de8adbfa568680ed81a0ad72adf5e6646 100644 (file)
@@ -783,7 +783,7 @@ static int axxia_i2c_probe(struct platform_device *pdev)
        }
 
        i2c_set_adapdata(&idev->adapter, idev);
-       strlcpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
+       strscpy(idev->adapter.name, pdev->name, sizeof(idev->adapter.name));
        idev->adapter.owner = THIS_MODULE;
        idev->adapter.algo = &axxia_i2c_algo;
        idev->adapter.bus_recovery_info = &axxia_i2c_recovery_info;
index 16bf41f1f0865a1d21f36e87d46186a954d32284..f3e369f0fd402056d00656bfb3e1ee98523781aa 100644 (file)
@@ -839,7 +839,7 @@ static int bcm_kona_i2c_probe(struct platform_device *pdev)
        adap = &dev->adapter;
        i2c_set_adapdata(adap, dev);
        adap->owner = THIS_MODULE;
-       strlcpy(adap->name, "Broadcom I2C adapter", sizeof(adap->name));
+       strscpy(adap->name, "Broadcom I2C adapter", sizeof(adap->name));
        adap->algo = &bcm_algo;
        adap->dev.parent = &pdev->dev;
        adap->dev.of_node = pdev->dev.of_node;
index 2ae187e2b642b52c0d76d98fc61fe9344bbc95b5..69383be4790593b7370880af4b8c367bc4e9c625 100644 (file)
@@ -674,7 +674,7 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
        adap = &dev->adapter;
        i2c_set_adapdata(adap, dev);
        adap->owner = THIS_MODULE;
-       strlcpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
+       strscpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
        adap->algo = &brcmstb_i2c_algo;
        adap->dev.parent = &pdev->dev;
        adap->dev.of_node = pdev->dev.of_node;
index f8639a4457d23ae55eece7874c10e3a05562b58d..d97c61eec95c16311d079edfae89207416fe97b3 100644 (file)
@@ -245,7 +245,7 @@ static int cbus_i2c_probe(struct platform_device *pdev)
        adapter->nr             = pdev->id;
        adapter->timeout        = HZ;
        adapter->algo           = &cbus_i2c_algo;
-       strlcpy(adapter->name, "CBUS I2C adapter", sizeof(adapter->name));
+       strscpy(adapter->name, "CBUS I2C adapter", sizeof(adapter->name));
 
        spin_lock_init(&chost->lock);
        chost->dev = &pdev->dev;
index de15f09c9b47ff0724dc15cb324e61f85c96a92b..190abdc46dd304213bdb22ac25165035d81cb0c2 100644 (file)
@@ -404,7 +404,7 @@ static int cht_wc_i2c_adap_i2c_probe(struct platform_device *pdev)
        adap->adapter.class = I2C_CLASS_HWMON;
        adap->adapter.algo = &cht_wc_i2c_adap_algo;
        adap->adapter.lock_ops = &cht_wc_i2c_adap_lock_ops;
-       strlcpy(adap->adapter.name, "PMIC I2C Adapter",
+       strscpy(adap->adapter.name, "PMIC I2C Adapter",
                sizeof(adap->adapter.name));
        adap->adapter.dev.parent = &pdev->dev;
 
index 892213d51f4331411a9d451507b459569a2cf61b..4e787dc709f91ec7324619c413fa029e71d56079 100644 (file)
@@ -267,7 +267,7 @@ static int ec_i2c_probe(struct platform_device *pdev)
        bus->dev = dev;
 
        bus->adap.owner = THIS_MODULE;
-       strlcpy(bus->adap.name, "cros-ec-i2c-tunnel", sizeof(bus->adap.name));
+       strscpy(bus->adap.name, "cros-ec-i2c-tunnel", sizeof(bus->adap.name));
        bus->adap.algo = &ec_i2c_algorithm;
        bus->adap.algo_data = bus;
        bus->adap.dev.parent = &pdev->dev;
index 9e09db31a937e5e72df2399ca0893fc527bd8b91..471c47db546bf8ddffc9b069d8a58a1793bbed4a 100644 (file)
@@ -845,7 +845,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
        i2c_set_adapdata(adap, dev);
        adap->owner = THIS_MODULE;
        adap->class = I2C_CLASS_DEPRECATED;
-       strlcpy(adap->name, "DaVinci I2C adapter", sizeof(adap->name));
+       strscpy(adap->name, "DaVinci I2C adapter", sizeof(adap->name));
        adap->algo = &i2c_davinci_algo;
        adap->dev.parent = &pdev->dev;
        adap->timeout = DAVINCI_I2C_TIMEOUT;
index 60c838c7c4544c0c22800716ca5b75f5f4fe4811..50925d97fa429c5a9b3dd306e753ef227d2b09fa 100644 (file)
@@ -322,7 +322,7 @@ static int dc_i2c_probe(struct platform_device *pdev)
        if (ret < 0)
                return ret;
 
-       strlcpy(i2c->adap.name, "Conexant Digicolor I2C adapter",
+       strscpy(i2c->adap.name, "Conexant Digicolor I2C adapter",
                sizeof(i2c->adap.name));
        i2c->adap.owner = THIS_MODULE;
        i2c->adap.algo = &dc_i2c_algorithm;
index 321b2770feabc04c91c292e106261df0fdbb3ed9..4914bfbee2a97736d61eab913650fa4aea7f163c 100644 (file)
@@ -773,7 +773,7 @@ static int pch_i2c_probe(struct pci_dev *pdev,
 
                pch_adap->owner = THIS_MODULE;
                pch_adap->class = I2C_CLASS_HWMON;
-               strlcpy(pch_adap->name, KBUILD_MODNAME, sizeof(pch_adap->name));
+               strscpy(pch_adap->name, KBUILD_MODNAME, sizeof(pch_adap->name));
                pch_adap->algo = &pch_algorithm;
                pch_adap->algo_data = &adap_info->pch_data[i];
 
index bdff0e6345d9a7cf71fd0b3b54c2f75807c4b162..f2e537b137b2004f87e24d7bc7180e3bdca7a9b7 100644 (file)
@@ -371,7 +371,7 @@ static int em_i2c_probe(struct platform_device *pdev)
        if (IS_ERR(priv->base))
                return PTR_ERR(priv->base);
 
-       strlcpy(priv->adap.name, "EMEV2 I2C", sizeof(priv->adap.name));
+       strscpy(priv->adap.name, "EMEV2 I2C", sizeof(priv->adap.name));
 
        priv->sclk = devm_clk_get(&pdev->dev, "sclk");
        if (IS_ERR(priv->sclk))
index b812d1090c0f6cc128d1bc9b2f0a17395132b4bc..4a6260d04db2810fdd89505211428e97d1401c51 100644 (file)
@@ -802,7 +802,7 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
        if (of_property_read_u32(np, "clock-frequency", &i2c->op_clock))
                i2c->op_clock = I2C_MAX_STANDARD_MODE_FREQ;
 
-       strlcpy(i2c->adap.name, "exynos5-i2c", sizeof(i2c->adap.name));
+       strscpy(i2c->adap.name, "exynos5-i2c", sizeof(i2c->adap.name));
        i2c->adap.owner   = THIS_MODULE;
        i2c->adap.algo    = &exynos5_i2c_algorithm;
        i2c->adap.retries = 3;
index 7a048abbf92b28ee40e48e07bb8b3b72ace20799..b1985c1667e163bcb810c9c0786620bd3ebf4d04 100644 (file)
@@ -436,7 +436,7 @@ static int i2c_gpio_probe(struct platform_device *pdev)
 
        adap->owner = THIS_MODULE;
        if (np)
-               strlcpy(adap->name, dev_name(dev), sizeof(adap->name));
+               strscpy(adap->name, dev_name(dev), sizeof(adap->name));
        else
                snprintf(adap->name, sizeof(adap->name), "i2c-gpio%d", pdev->id);
 
index a2add128d084392f7319564ce28d7172054ea0c9..4374a8677271765783ac31e9e42a3c2d32a34315 100644 (file)
@@ -402,7 +402,7 @@ static int highlander_i2c_probe(struct platform_device *pdev)
        i2c_set_adapdata(adap, dev);
        adap->owner = THIS_MODULE;
        adap->class = I2C_CLASS_HWMON;
-       strlcpy(adap->name, "HL FPGA I2C adapter", sizeof(adap->name));
+       strscpy(adap->name, "HL FPGA I2C adapter", sizeof(adap->name));
        adap->algo = &highlander_i2c_algo;
        adap->dev.parent = &pdev->dev;
        adap->nr = pdev->id;
index 61ae58f5704758e7a0f905978304e5638135416a..0e34cbaca22dc37c4bcc7a39a60dda6104f0971b 100644 (file)
@@ -423,7 +423,7 @@ static int hix5hd2_i2c_probe(struct platform_device *pdev)
        }
        clk_prepare_enable(priv->clk);
 
-       strlcpy(priv->adap.name, "hix5hd2-i2c", sizeof(priv->adap.name));
+       strscpy(priv->adap.name, "hix5hd2-i2c", sizeof(priv->adap.name));
        priv->dev = &pdev->dev;
        priv->adap.owner = THIS_MODULE;
        priv->adap.algo = &hix5hd2_i2c_algorithm;
index 81d0da2547bd77f76be4b27abf9a1b68583982ef..a176296f4fff1ca49379eb12e1ba1b8aea064327 100644 (file)
@@ -1116,7 +1116,7 @@ static void dmi_check_onboard_device(u8 type, const char *name,
 
                memset(&info, 0, sizeof(struct i2c_board_info));
                info.addr = dmi_devices[i].i2c_addr;
-               strlcpy(info.type, dmi_devices[i].i2c_type, I2C_NAME_SIZE);
+               strscpy(info.type, dmi_devices[i].i2c_type, I2C_NAME_SIZE);
                i2c_new_client_device(adap, &info);
                break;
        }
@@ -1267,7 +1267,7 @@ static void register_dell_lis3lv02d_i2c_device(struct i801_priv *priv)
 
        memset(&info, 0, sizeof(struct i2c_board_info));
        info.addr = dell_lis3lv02d_devices[i].i2c_addr;
-       strlcpy(info.type, "lis3lv02d", I2C_NAME_SIZE);
+       strscpy(info.type, "lis3lv02d", I2C_NAME_SIZE);
        i2c_new_client_device(&priv->adapter, &info);
 }
 
index 9f71daf6db64bdd932983a238c75bb517c5ca5ef..eeb80e34f9ad711337879106655628d32993be31 100644 (file)
@@ -738,7 +738,7 @@ static int iic_probe(struct platform_device *ofdev)
        adap = &dev->adap;
        adap->dev.parent = &ofdev->dev;
        adap->dev.of_node = of_node_get(np);
-       strlcpy(adap->name, "IBM IIC", sizeof(adap->name));
+       strscpy(adap->name, "IBM IIC", sizeof(adap->name));
        i2c_set_adapdata(adap, dev);
        adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
        adap->algo = &iic_algo;
index 5dae7cab7260559242a24d60005be2511d5a7743..febcb6f01d4d21357074396c2240748902895298 100644 (file)
@@ -141,7 +141,7 @@ static int icy_probe(struct zorro_dev *z,
        i2c->adapter.owner = THIS_MODULE;
        /* i2c->adapter.algo assigned by i2c_pcf_add_bus() */
        i2c->adapter.algo_data = algo_data;
-       strlcpy(i2c->adapter.name, "ICY I2C Zorro adapter",
+       strscpy(i2c->adapter.name, "ICY I2C Zorro adapter",
                sizeof(i2c->adapter.name));
 
        if (!devm_request_mem_region(&z->dev,
index 8b9ba055c4186c1e914f9f9f72a477b4a5ec2dee..b51ab3cad2b168b0e3714ec6695d8d3d73e58533 100644 (file)
@@ -558,7 +558,7 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
        lpi2c_imx->adapter.algo         = &lpi2c_imx_algo;
        lpi2c_imx->adapter.dev.parent   = &pdev->dev;
        lpi2c_imx->adapter.dev.of_node  = pdev->dev.of_node;
-       strlcpy(lpi2c_imx->adapter.name, pdev->name,
+       strscpy(lpi2c_imx->adapter.name, pdev->name,
                sizeof(lpi2c_imx->adapter.name));
 
        lpi2c_imx->clk = devm_clk_get(&pdev->dev, NULL);
index 4e30c5267142c3ced1947088e8983c4888ea3da7..8fff6fbb7065c0d9cf34a603cf0ea521007f6c12 100644 (file)
@@ -417,7 +417,7 @@ static int i2c_lpc2k_probe(struct platform_device *pdev)
 
        i2c_set_adapdata(&i2c->adap, i2c);
        i2c->adap.owner = THIS_MODULE;
-       strlcpy(i2c->adap.name, "LPC2K I2C adapter", sizeof(i2c->adap.name));
+       strscpy(i2c->adap.name, "LPC2K I2C adapter", sizeof(i2c->adap.name));
        i2c->adap.algo = &i2c_lpc2k_algorithm;
        i2c->adap.dev.parent = &pdev->dev;
        i2c->adap.dev.of_node = pdev->dev.of_node;
index 61cc5b2462c64c6c53278f854dea7611e47d046d..889eff06b78f4a9b58a0e3dc6b5653621218444c 100644 (file)
@@ -502,7 +502,7 @@ static int meson_i2c_probe(struct platform_device *pdev)
                return ret;
        }
 
-       strlcpy(i2c->adap.name, "Meson I2C adapter",
+       strscpy(i2c->adap.name, "Meson I2C adapter",
                sizeof(i2c->adap.name));
        i2c->adap.owner = THIS_MODULE;
        i2c->adap.algo = &meson_i2c_algorithm;
index bd8abba3d1c9cd8df24749fae7ed1c1596a7d0a4..fc7bfd98156ba730ff781aea280f87e4e07962e7 100644 (file)
@@ -1432,7 +1432,7 @@ static int mtk_i2c_probe(struct platform_device *pdev)
                speed_clk = I2C_MT65XX_CLK_MAIN;
        }
 
-       strlcpy(i2c->adap.name, I2C_DRV_NAME, sizeof(i2c->adap.name));
+       strscpy(i2c->adap.name, I2C_DRV_NAME, sizeof(i2c->adap.name));
 
        ret = mtk_i2c_set_speed(i2c, clk_get_rate(i2c->clocks[speed_clk].clk));
        if (ret) {
index cfe6de8175dde8abde94a900622bd3f29f59333e..20eda5738ac494ff28edbd5df207234b275d1496 100644 (file)
@@ -312,7 +312,7 @@ static int mtk_i2c_probe(struct platform_device *pdev)
        adap->dev.parent = &pdev->dev;
        i2c_set_adapdata(adap, i2c);
        adap->dev.of_node = pdev->dev.of_node;
-       strlcpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
+       strscpy(adap->name, dev_name(&pdev->dev), sizeof(adap->name));
 
        platform_set_drvdata(pdev, i2c);
 
index 103a05ecc3d6b07b96ec2a1dfbbf6cded2b57c0e..047dfef7a657750ef7ef75646b026d4ea3c168b9 100644 (file)
@@ -989,7 +989,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
        if (IS_ERR(drv_data->reg_base))
                return PTR_ERR(drv_data->reg_base);
 
-       strlcpy(drv_data->adapter.name, MV64XXX_I2C_CTLR_NAME " adapter",
+       strscpy(drv_data->adapter.name, MV64XXX_I2C_CTLR_NAME " adapter",
                sizeof(drv_data->adapter.name));
 
        init_waitqueue_head(&drv_data->waitq);
index 68f67d084c63a784893c709c4f92ccadeeb262a3..5af5cffc444ef0cbbff5812f6bb67dace170744d 100644 (file)
@@ -838,7 +838,7 @@ static int mxs_i2c_probe(struct platform_device *pdev)
                return err;
 
        adap = &i2c->adapter;
-       strlcpy(adap->name, "MXS I2C adapter", sizeof(adap->name));
+       strscpy(adap->name, "MXS I2C adapter", sizeof(adap->name));
        adap->owner = THIS_MODULE;
        adap->algo = &mxs_i2c_algo;
        adap->quirks = &mxs_i2c_quirks;
index 6920c1b9a12623f3bc6201ea7e99ca8eaf71f839..12e330cd7635ba4860889f97966f6158321fbbc0 100644 (file)
@@ -299,7 +299,7 @@ static int gpu_i2c_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
        i2c_set_adapdata(&i2cd->adapter, i2cd);
        i2cd->adapter.owner = THIS_MODULE;
-       strlcpy(i2cd->adapter.name, "NVIDIA GPU I2C adapter",
+       strscpy(i2cd->adapter.name, "NVIDIA GPU I2C adapter",
                sizeof(i2cd->adapter.name));
        i2cd->adapter.algo = &gpu_i2c_algorithm;
        i2cd->adapter.quirks = &gpu_i2c_quirks;
index d4f6c6d60683af26012572f7d7f68e3e3156a97f..f9ae520aed22863ba19e98c99a640115bec91f90 100644 (file)
@@ -1488,7 +1488,7 @@ omap_i2c_probe(struct platform_device *pdev)
        i2c_set_adapdata(adap, omap);
        adap->owner = THIS_MODULE;
        adap->class = I2C_CLASS_DEPRECATED;
-       strlcpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
+       strscpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
        adap->algo = &omap_i2c_algo;
        adap->quirks = &omap_i2c_quirks;
        adap->dev.parent = &pdev->dev;
index 6eb0f50c5d2878d73e1395bfe0c8e209bceb7c07..9f773b4f5ed8e439d60c4033fb962e5d089d9e3a 100644 (file)
@@ -220,9 +220,9 @@ static int i2c_opal_probe(struct platform_device *pdev)
        adapter->dev.of_node = of_node_get(pdev->dev.of_node);
        pname = of_get_property(pdev->dev.of_node, "ibm,port-name", NULL);
        if (pname)
-               strlcpy(adapter->name, pname, sizeof(adapter->name));
+               strscpy(adapter->name, pname, sizeof(adapter->name));
        else
-               strlcpy(adapter->name, "opal", sizeof(adapter->name));
+               strscpy(adapter->name, "opal", sizeof(adapter->name));
 
        platform_set_drvdata(pdev, adapter);
        rc = i2c_add_adapter(adapter);
index 231145c48728e503f3b1eeefbf20aeea420edc31..0af86a542568367ce04234b1f7e8db6b16ab11b5 100644 (file)
@@ -308,7 +308,7 @@ static void i2c_parport_attach(struct parport *port)
        /* Fill the rest of the structure */
        adapter->adapter.owner = THIS_MODULE;
        adapter->adapter.class = I2C_CLASS_HWMON;
-       strlcpy(adapter->adapter.name, "Parallel port adapter",
+       strscpy(adapter->adapter.name, "Parallel port adapter",
                sizeof(adapter->adapter.name));
        adapter->algo_data = parport_algo_data;
        /* Slow down if we can't sense SCL */
index 690188a9ffff5ea7cb4c8d3242b99ac6af8b145c..b605b6e43cb90f360955ba331b316533c54fd954 100644 (file)
@@ -1403,7 +1403,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
        spin_lock_init(&i2c->lock);
        init_waitqueue_head(&i2c->wait);
 
-       strlcpy(i2c->adap.name, "pxa_i2c-i2c", sizeof(i2c->adap.name));
+       strscpy(i2c->adap.name, "pxa_i2c-i2c", sizeof(i2c->adap.name));
 
        i2c->clk = devm_clk_get(&dev->dev, NULL);
        if (IS_ERR(i2c->clk)) {
index 1bef67fe4b256d434e9d6538e98efdc36a3bc167..84a77512614d9fbdd9462cf5644426af3d4b2de4 100644 (file)
@@ -817,7 +817,7 @@ static int geni_i2c_probe(struct platform_device *pdev)
        i2c_set_adapdata(&gi2c->adap, gi2c);
        gi2c->adap.dev.parent = dev;
        gi2c->adap.dev.of_node = dev->of_node;
-       strlcpy(gi2c->adap.name, "Geni-I2C", sizeof(gi2c->adap.name));
+       strscpy(gi2c->adap.name, "Geni-I2C", sizeof(gi2c->adap.name));
 
        ret = geni_icc_get(&gi2c->se, "qup-memory");
        if (ret)
index 69e9f3ecf87d7860249f8449b8bd02663887a663..2e153f2f71b6d8e9cde863759033d46c3c850ad7 100644 (file)
@@ -1878,7 +1878,7 @@ nodma:
        qup->adap.dev.of_node = pdev->dev.of_node;
        qup->is_last = true;
 
-       strlcpy(qup->adap.name, "QUP I2C adapter", sizeof(qup->adap.name));
+       strscpy(qup->adap.name, "QUP I2C adapter", sizeof(qup->adap.name));
 
        pm_runtime_set_autosuspend_delay(qup->dev, MSEC_PER_SEC);
        pm_runtime_use_autosuspend(qup->dev);
index 6e7be9d9f5043c00f1c2deec0e7219a8d695888c..cef82b205c261ccb993b8ec2cae136d51b977546 100644 (file)
@@ -1076,7 +1076,7 @@ static int rcar_i2c_probe(struct platform_device *pdev)
        adap->bus_recovery_info = &rcar_i2c_bri;
        adap->quirks = &rcar_i2c_quirks;
        i2c_set_adapdata(adap, priv);
-       strlcpy(adap->name, pdev->name, sizeof(adap->name));
+       strscpy(adap->name, pdev->name, sizeof(adap->name));
 
        /* Init DMA */
        sg_init_table(&priv->sg, 1);
index cded77e066704d88f4f0bfe1ea261a8ed6517240..ecba1dfc127887346b9043b1b68857a93eb481c3 100644 (file)
@@ -448,7 +448,7 @@ static int riic_i2c_probe(struct platform_device *pdev)
 
        adap = &riic->adapter;
        i2c_set_adapdata(adap, riic);
-       strlcpy(adap->name, "Renesas RIIC adapter", sizeof(adap->name));
+       strscpy(adap->name, "Renesas RIIC adapter", sizeof(adap->name));
        adap->owner = THIS_MODULE;
        adap->algo = &riic_algo;
        adap->dev.parent = &pdev->dev;
index 989040a73626dd03b3ae22d614d55c37674ac964..2e98e7793bbae0fd36c4d635de8bd5da8602613b 100644 (file)
@@ -1240,7 +1240,7 @@ static int rk3x_i2c_probe(struct platform_device *pdev)
        /* use common interface to get I2C timing properties */
        i2c_parse_fw_timings(&pdev->dev, &i2c->t, true);
 
-       strlcpy(i2c->adap.name, "rk3x-i2c", sizeof(i2c->adap.name));
+       strscpy(i2c->adap.name, "rk3x-i2c", sizeof(i2c->adap.name));
        i2c->adap.owner = THIS_MODULE;
        i2c->adap.algo = &rk3x_i2c_algorithm;
        i2c->adap.retries = 3;
index b49a1b170bb2f1d2c0659cdae86c1c983acdc70e..36dab9cd208cfeee3ae45ea55111dfc70924b39d 100644 (file)
@@ -1076,7 +1076,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
        else
                s3c24xx_i2c_parse_dt(pdev->dev.of_node, i2c);
 
-       strlcpy(i2c->adap.name, "s3c2410-i2c", sizeof(i2c->adap.name));
+       strscpy(i2c->adap.name, "s3c2410-i2c", sizeof(i2c->adap.name));
        i2c->adap.owner = THIS_MODULE;
        i2c->adap.algo = &s3c24xx_i2c_algorithm;
        i2c->adap.retries = 2;
index 72f024a0c363209b747092fd4db50b68917127fc..29330ee64c9c039f0c9f760b27ac48e910de440a 100644 (file)
@@ -940,7 +940,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
        adap->nr = dev->id;
        adap->dev.of_node = dev->dev.of_node;
 
-       strlcpy(adap->name, dev->name, sizeof(adap->name));
+       strscpy(adap->name, dev->name, sizeof(adap->name));
 
        spin_lock_init(&pd->lock);
        init_waitqueue_head(&pd->wait);
index 458c7bcf1d246e7e5f23e33bb7a490960e12b64c..87701744752fb77f89c32e2ed49e93b69bae6b2c 100644 (file)
@@ -99,7 +99,7 @@ static int simtec_i2c_probe(struct platform_device *dev)
        pd->adap.algo_data = &pd->bit;
        pd->adap.dev.parent = &dev->dev;
 
-       strlcpy(pd->adap.name, "Simtec I2C", sizeof(pd->adap.name));
+       strscpy(pd->adap.name, "Simtec I2C", sizeof(pd->adap.name));
 
        pd->bit.data = pd;
        pd->bit.setsda = simtec_i2c_setsda;
index b4050f5b6746a8a8010dc08f2aa5aa92b815d631..b0f0120793e17684018a1c9cd4ae233c0e03b402 100644 (file)
@@ -239,7 +239,7 @@ static int taos_connect(struct serio *serio, struct serio_driver *drv)
                dev_err(&serio->dev, "TAOS EVM identification failed\n");
                goto exit_close;
        }
-       strlcpy(adapter->name, name, sizeof(adapter->name));
+       strscpy(adapter->name, name, sizeof(adapter->name));
 
        /* Turn echo off for better performance */
        taos->state = TAOS_STATE_EOFF;
index ec0c7cad424019067306142ce2192696a53d4cec..95139985b2d5efdaa390c556dc9041be63a1edcd 100644 (file)
@@ -305,7 +305,7 @@ static int tegra_bpmp_i2c_probe(struct platform_device *pdev)
 
        i2c_set_adapdata(&i2c->adapter, i2c);
        i2c->adapter.owner = THIS_MODULE;
-       strlcpy(i2c->adapter.name, "Tegra BPMP I2C adapter",
+       strscpy(i2c->adapter.name, "Tegra BPMP I2C adapter",
                sizeof(i2c->adapter.name));
        i2c->adapter.algo = &tegra_bpmp_i2c_algo;
        i2c->adapter.dev.parent = &pdev->dev;
index 2941e42aa6a077f6b1439622bacabb303293f755..031c78ac42e67f6a7676af04214b3ce5cd0551a7 100644 (file)
@@ -1825,7 +1825,7 @@ static int tegra_i2c_probe(struct platform_device *pdev)
        if (i2c_dev->hw->supports_bus_clear)
                i2c_dev->adapter.bus_recovery_info = &tegra_i2c_recovery_info;
 
-       strlcpy(i2c_dev->adapter.name, dev_name(i2c_dev->dev),
+       strscpy(i2c_dev->adapter.name, dev_name(i2c_dev->dev),
                sizeof(i2c_dev->adapter.name));
 
        err = i2c_add_numbered_adapter(&i2c_dev->adapter);
index cb4666c54a233023efb7663e89e51a1977a07f7b..d7b622891e52decb3e313ec3aa656fd122c4e23e 100644 (file)
@@ -564,7 +564,7 @@ static int uniphier_fi2c_probe(struct platform_device *pdev)
        priv->adap.algo = &uniphier_fi2c_algo;
        priv->adap.dev.parent = dev;
        priv->adap.dev.of_node = dev->of_node;
-       strlcpy(priv->adap.name, "UniPhier FI2C", sizeof(priv->adap.name));
+       strscpy(priv->adap.name, "UniPhier FI2C", sizeof(priv->adap.name));
        priv->adap.bus_recovery_info = &uniphier_fi2c_bus_recovery_info;
        i2c_set_adapdata(&priv->adap, priv);
        platform_set_drvdata(pdev, priv);
index ee00a44bf4c719bd19d1f51fdcc15616dea97145..e3ebae381f08af31c5c10034600305a5f415ad38 100644 (file)
@@ -358,7 +358,7 @@ static int uniphier_i2c_probe(struct platform_device *pdev)
        priv->adap.algo = &uniphier_i2c_algo;
        priv->adap.dev.parent = dev;
        priv->adap.dev.of_node = dev->of_node;
-       strlcpy(priv->adap.name, "UniPhier I2C", sizeof(priv->adap.name));
+       strscpy(priv->adap.name, "UniPhier I2C", sizeof(priv->adap.name));
        priv->adap.bus_recovery_info = &uniphier_i2c_bus_recovery_info;
        i2c_set_adapdata(&priv->adap, priv);
        platform_set_drvdata(pdev, priv);
index 8d980b1374a8d2cd979cce205d4f995f4cd0db34..1ab419f8fa527f08428a7b2646af9e86a91838cc 100644 (file)
@@ -79,7 +79,7 @@ static int i2c_versatile_probe(struct platform_device *dev)
        writel(SCL | SDA, i2c->base + I2C_CONTROLS);
 
        i2c->adap.owner = THIS_MODULE;
-       strlcpy(i2c->adap.name, "Versatile I2C adapter", sizeof(i2c->adap.name));
+       strscpy(i2c->adap.name, "Versatile I2C adapter", sizeof(i2c->adap.name));
        i2c->adap.algo_data = &i2c->algo;
        i2c->adap.dev.parent = &dev->dev;
        i2c->adap.dev.of_node = dev->dev.of_node;
index 88f5aafdce5b4d8df55ab09ccf6025b78d496244..7d4bc8736079323784dbff65b833e98dce303353 100644 (file)
@@ -413,7 +413,7 @@ static int wmt_i2c_probe(struct platform_device *pdev)
 
        adap = &i2c_dev->adapter;
        i2c_set_adapdata(adap, i2c_dev);
-       strlcpy(adap->name, "WMT I2C adapter", sizeof(adap->name));
+       strscpy(adap->name, "WMT I2C adapter", sizeof(adap->name));
        adap->owner = THIS_MODULE;
        adap->algo = &wmt_i2c_algo;
        adap->dev.parent = &pdev->dev;