]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Input: move from strlcpy with unused retval to strscpy
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 18 Aug 2022 22:05:06 +0000 (15:05 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Thu, 18 Aug 2022 22:44:08 +0000 (15:44 -0700)
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.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20220818210022.6865-1-wsa+renesas@sang-engineering.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
35 files changed:
drivers/input/keyboard/lkkbd.c
drivers/input/misc/keyspan_remote.c
drivers/input/mouse/hgpk.c
drivers/input/mouse/synaptics.c
drivers/input/mouse/synaptics_usb.c
drivers/input/mouse/vsxxxaa.c
drivers/input/rmi4/rmi_f03.c
drivers/input/rmi4/rmi_f54.c
drivers/input/serio/altera_ps2.c
drivers/input/serio/ambakmi.c
drivers/input/serio/ams_delta_serio.c
drivers/input/serio/apbps2.c
drivers/input/serio/ct82c710.c
drivers/input/serio/gscps2.c
drivers/input/serio/hyperv-keyboard.c
drivers/input/serio/i8042-x86ia64io.h
drivers/input/serio/i8042.c
drivers/input/serio/olpc_apsp.c
drivers/input/serio/parkbd.c
drivers/input/serio/pcips2.c
drivers/input/serio/ps2-gpio.c
drivers/input/serio/ps2mult.c
drivers/input/serio/q40kbd.c
drivers/input/serio/rpckbd.c
drivers/input/serio/sa1111ps2.c
drivers/input/serio/serport.c
drivers/input/serio/sun4i-ps2.c
drivers/input/tablet/acecad.c
drivers/input/tablet/hanwang.c
drivers/input/tablet/pegasus_notetaker.c
drivers/input/touchscreen/atmel_mxt_ts.c
drivers/input/touchscreen/edt-ft5x06.c
drivers/input/touchscreen/sur40.c
drivers/input/touchscreen/usbtouchscreen.c
drivers/input/touchscreen/wacom_w8001.c

index e4a1839ca934aa97c5e47017b135d4d3b9a10d5a..ea9a1d8834c1c0332eb62f70c2cbfef0fa0f2efc 100644 (file)
@@ -359,18 +359,18 @@ static void lkkbd_detection_done(struct lkkbd *lk)
         */
        switch (lk->id[4]) {
        case 1:
-               strlcpy(lk->name, "DEC LK201 keyboard", sizeof(lk->name));
+               strscpy(lk->name, "DEC LK201 keyboard", sizeof(lk->name));
 
                if (lk201_compose_is_alt)
                        lk->keycode[0xb1] = KEY_LEFTALT;
                break;
 
        case 2:
-               strlcpy(lk->name, "DEC LK401 keyboard", sizeof(lk->name));
+               strscpy(lk->name, "DEC LK401 keyboard", sizeof(lk->name));
                break;
 
        default:
-               strlcpy(lk->name, "Unknown DEC keyboard", sizeof(lk->name));
+               strscpy(lk->name, "Unknown DEC keyboard", sizeof(lk->name));
                printk(KERN_ERR
                        "lkkbd: keyboard on %s is unknown, please report to "
                        "Jan-Benedict Glaw <jbglaw@lug-owl.de>\n", lk->phys);
@@ -626,7 +626,7 @@ static int lkkbd_connect(struct serio *serio, struct serio_driver *drv)
        lk->ctrlclick_volume = ctrlclick_volume;
        memcpy(lk->keycode, lkkbd_keycode, sizeof(lk->keycode));
 
-       strlcpy(lk->name, "DEC LK keyboard", sizeof(lk->name));
+       strscpy(lk->name, "DEC LK keyboard", sizeof(lk->name));
        snprintf(lk->phys, sizeof(lk->phys), "%s/input0", serio->phys);
 
        input_dev->name = lk->name;
index 4650f4a949890f577af46898ab7967210b5a9486..bee4b137649144a7fb1a9d0bed9d5d584c971227 100644 (file)
@@ -485,7 +485,7 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
        }
 
        if (udev->manufacturer)
-               strlcpy(remote->name, udev->manufacturer, sizeof(remote->name));
+               strscpy(remote->name, udev->manufacturer, sizeof(remote->name));
 
        if (udev->product) {
                if (udev->manufacturer)
index 4dc441309aacf54463648ca494bbab21355902b5..523b26a117d6ceaa4c8f886f55d301c1112b294f 100644 (file)
@@ -1057,7 +1057,7 @@ void hgpk_module_init(void)
                                                strlen(hgpk_mode_name));
        if (hgpk_default_mode == HGPK_MODE_INVALID) {
                hgpk_default_mode = HGPK_MODE_MOUSE;
-               strlcpy(hgpk_mode_name, hgpk_mode_names[HGPK_MODE_MOUSE],
+               strscpy(hgpk_mode_name, hgpk_mode_names[HGPK_MODE_MOUSE],
                        sizeof(hgpk_mode_name));
        }
 }
index 434d48ae4b12e8a0fc27658d26ff55e18812497f..e3f657713b557ea58f459c4e07930606d5afa121 100644 (file)
@@ -715,8 +715,8 @@ static void synaptics_pt_create(struct psmouse *psmouse)
        }
 
        serio->id.type = SERIO_PS_PSTHRU;
-       strlcpy(serio->name, "Synaptics pass-through", sizeof(serio->name));
-       strlcpy(serio->phys, "synaptics-pt/serio0", sizeof(serio->phys));
+       strscpy(serio->name, "Synaptics pass-through", sizeof(serio->name));
+       strscpy(serio->phys, "synaptics-pt/serio0", sizeof(serio->phys));
        serio->write = synaptics_pt_write;
        serio->start = synaptics_pt_start;
        serio->stop = synaptics_pt_stop;
index b5ff27e32a0c8a8282f426c13beb527231b77c61..75e45f3ae675cf9a384384a288de5e20a4cf44ad 100644 (file)
@@ -354,7 +354,7 @@ static int synusb_probe(struct usb_interface *intf,
        synusb->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 
        if (udev->manufacturer)
-               strlcpy(synusb->name, udev->manufacturer,
+               strscpy(synusb->name, udev->manufacturer,
                        sizeof(synusb->name));
 
        if (udev->product) {
index bd415f4b574e53a08128b071fafc79d97301a622..3bd6e723a4220ec8f43a82ff97b876b3da8b30ee 100644 (file)
@@ -138,12 +138,12 @@ static void vsxxxaa_detection_done(struct vsxxxaa *mouse)
 {
        switch (mouse->type) {
        case 0x02:
-               strlcpy(mouse->name, "DEC VSXXX-AA/-GA mouse",
+               strscpy(mouse->name, "DEC VSXXX-AA/-GA mouse",
                        sizeof(mouse->name));
                break;
 
        case 0x04:
-               strlcpy(mouse->name, "DEC VSXXX-AB digitizer",
+               strscpy(mouse->name, "DEC VSXXX-AB digitizer",
                        sizeof(mouse->name));
                break;
 
index c194b1664b108926b2197e651c0ad4b62001d91e..1e11ea30d7bdb81c26e5cc44944a1852688f7f79 100644 (file)
@@ -181,7 +181,7 @@ static int rmi_f03_register_pt(struct f03_data *f03)
        serio->close = rmi_f03_pt_close;
        serio->port_data = f03;
 
-       strlcpy(serio->name, "RMI4 PS/2 pass-through", sizeof(serio->name));
+       strscpy(serio->name, "RMI4 PS/2 pass-through", sizeof(serio->name));
        snprintf(serio->phys, sizeof(serio->phys), "%s/serio0",
                 dev_name(&f03->fn->dev));
        serio->dev.parent = &f03->fn->dev;
index c5ce907535ef998ba5616e5beee0c11fdf8a87de..5c3da910b5b2ce1201e5e05626786f9dc750e4f0 100644 (file)
@@ -390,8 +390,8 @@ static int rmi_f54_vidioc_querycap(struct file *file, void *priv,
 {
        struct f54_data *f54 = video_drvdata(file);
 
-       strlcpy(cap->driver, F54_NAME, sizeof(cap->driver));
-       strlcpy(cap->card, SYNAPTICS_INPUT_DEVICE_NAME, sizeof(cap->card));
+       strscpy(cap->driver, F54_NAME, sizeof(cap->driver));
+       strscpy(cap->card, SYNAPTICS_INPUT_DEVICE_NAME, sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                "rmi4:%s", dev_name(&f54->fn->dev));
 
@@ -410,7 +410,7 @@ static int rmi_f54_vidioc_enum_input(struct file *file, void *priv,
 
        i->type = V4L2_INPUT_TYPE_TOUCH;
 
-       strlcpy(i->name, rmi_f54_report_type_names[reptype], sizeof(i->name));
+       strscpy(i->name, rmi_f54_report_type_names[reptype], sizeof(i->name));
        return 0;
 }
 
@@ -696,7 +696,7 @@ static int rmi_f54_probe(struct rmi_function *fn)
        rmi_f54_set_input(f54, 0);
 
        /* register video device */
-       strlcpy(f54->v4l2.name, F54_NAME, sizeof(f54->v4l2.name));
+       strscpy(f54->v4l2.name, F54_NAME, sizeof(f54->v4l2.name));
        ret = v4l2_device_register(&fn->dev, &f54->v4l2);
        if (ret) {
                dev_err(&fn->dev, "Unable to register video dev.\n");
index 379e9240c2b334798bba36ccc8d1bd3253c06159..3a92304f64fb3f6394f8af0ceedd210c7bddadfb 100644 (file)
@@ -110,8 +110,8 @@ static int altera_ps2_probe(struct platform_device *pdev)
        serio->write            = altera_ps2_write;
        serio->open             = altera_ps2_open;
        serio->close            = altera_ps2_close;
-       strlcpy(serio->name, dev_name(&pdev->dev), sizeof(serio->name));
-       strlcpy(serio->phys, dev_name(&pdev->dev), sizeof(serio->phys));
+       strscpy(serio->name, dev_name(&pdev->dev), sizeof(serio->name));
+       strscpy(serio->phys, dev_name(&pdev->dev), sizeof(serio->phys));
        serio->port_data        = ps2if;
        serio->dev.parent       = &pdev->dev;
        ps2if->io               = serio;
index 4408245b61d2c6707bf136fc0d82a7e11795916a..c391700fc4ae2c694ff7aa3cf579b005f3b88004 100644 (file)
@@ -126,8 +126,8 @@ static int amba_kmi_probe(struct amba_device *dev,
        io->write       = amba_kmi_write;
        io->open        = amba_kmi_open;
        io->close       = amba_kmi_close;
-       strlcpy(io->name, dev_name(&dev->dev), sizeof(io->name));
-       strlcpy(io->phys, dev_name(&dev->dev), sizeof(io->phys));
+       strscpy(io->name, dev_name(&dev->dev), sizeof(io->name));
+       strscpy(io->phys, dev_name(&dev->dev), sizeof(io->phys));
        io->port_data   = kmi;
        io->dev.parent  = &dev->dev;
 
index 1c0be299f17904b2cc23ebd18b7068b0854b2c9a..ec93cb4573c3e1a88ba95bdfe81b5c95ea6845c6 100644 (file)
@@ -159,8 +159,8 @@ static int ams_delta_serio_init(struct platform_device *pdev)
        serio->id.type = SERIO_8042;
        serio->open = ams_delta_serio_open;
        serio->close = ams_delta_serio_close;
-       strlcpy(serio->name, "AMS DELTA keyboard adapter", sizeof(serio->name));
-       strlcpy(serio->phys, dev_name(&pdev->dev), sizeof(serio->phys));
+       strscpy(serio->name, "AMS DELTA keyboard adapter", sizeof(serio->name));
+       strscpy(serio->phys, dev_name(&pdev->dev), sizeof(serio->phys));
        serio->dev.parent = &pdev->dev;
        serio->port_data = priv;
 
index 974d7bfae0a03a6581b82bed4b55b67a7298962e..9c9ce097f8bf187aa37b12226d9a5c5de2869d14 100644 (file)
@@ -176,7 +176,7 @@ static int apbps2_of_probe(struct platform_device *ofdev)
        priv->io->close = apbps2_close;
        priv->io->write = apbps2_write;
        priv->io->port_data = priv;
-       strlcpy(priv->io->name, "APBPS2 PS/2", sizeof(priv->io->name));
+       strscpy(priv->io->name, "APBPS2 PS/2", sizeof(priv->io->name));
        snprintf(priv->io->phys, sizeof(priv->io->phys),
                 "apbps2_%d", apbps2_idx++);
 
index d45009d654bf7e48b258dab28b0e9d02fc2a78ec..752ce60e2211689b373ffa4ebd845e7d2fcb640b 100644 (file)
@@ -170,7 +170,7 @@ static int ct82c710_probe(struct platform_device *dev)
        ct82c710_port->open = ct82c710_open;
        ct82c710_port->close = ct82c710_close;
        ct82c710_port->write = ct82c710_write;
-       strlcpy(ct82c710_port->name, "C&T 82c710 mouse port",
+       strscpy(ct82c710_port->name, "C&T 82c710 mouse port",
                sizeof(ct82c710_port->name));
        snprintf(ct82c710_port->phys, sizeof(ct82c710_port->phys),
                 "isa%16llx/serio0", (unsigned long long)CT82C710_DATA);
index da2c67cb864225a3b917da1992a7a54a07c784e7..633c7de49d671547e16e257667110e71a1829a67 100644 (file)
@@ -361,7 +361,7 @@ static int __init gscps2_probe(struct parisc_device *dev)
 
        snprintf(serio->name, sizeof(serio->name), "gsc-ps2-%s",
                 (ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse");
-       strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys));
+       strscpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys));
        serio->id.type          = SERIO_8042;
        serio->write            = gscps2_write;
        serio->open             = gscps2_open;
index 1a7b72a9016d7418818e61f8ebad50a8a718a52a..d62aefb2e24515501fb8a5ac1de751ed671d58f9 100644 (file)
@@ -334,9 +334,9 @@ static int hv_kbd_probe(struct hv_device *hv_dev,
        hv_serio->dev.parent  = &hv_dev->device;
        hv_serio->id.type = SERIO_8042_XL;
        hv_serio->port_data = kbd_dev;
-       strlcpy(hv_serio->name, dev_name(&hv_dev->device),
+       strscpy(hv_serio->name, dev_name(&hv_dev->device),
                sizeof(hv_serio->name));
-       strlcpy(hv_serio->phys, dev_name(&hv_dev->device),
+       strscpy(hv_serio->phys, dev_name(&hv_dev->device),
                sizeof(hv_serio->phys));
 
        hv_serio->start = hv_kbd_start;
index 4fbec7bbeccaaa1e7cde926d6bbef3c233550443..732b7a6b315d647fec1af1ef50d8530698cf19d1 100644 (file)
@@ -1300,7 +1300,7 @@ static char i8042_pnp_aux_name[32];
 
 static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
 {
-       strlcpy(dst, "PNP:", dst_size);
+       strscpy(dst, "PNP:", dst_size);
 
        while (id) {
                strlcat(dst, " ", dst_size);
@@ -1320,7 +1320,7 @@ static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *
        if (pnp_irq_valid(dev,0))
                i8042_pnp_kbd_irq = pnp_irq(dev, 0);
 
-       strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
+       strscpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
        if (strlen(pnp_dev_name(dev))) {
                strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
                strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
@@ -1347,7 +1347,7 @@ static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *
        if (pnp_irq_valid(dev, 0))
                i8042_pnp_aux_irq = pnp_irq(dev, 0);
 
-       strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
+       strscpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
        if (strlen(pnp_dev_name(dev))) {
                strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
                strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
index 3fc0a89cc785cb6b76bcaf49be8b573fb1682c8d..f9486495baefaa22c1db1d9cf859c75b2ac97384 100644 (file)
@@ -1341,9 +1341,9 @@ static int i8042_create_kbd_port(void)
        serio->ps2_cmd_mutex    = &i8042_mutex;
        serio->port_data        = port;
        serio->dev.parent       = &i8042_platform_device->dev;
-       strlcpy(serio->name, "i8042 KBD port", sizeof(serio->name));
-       strlcpy(serio->phys, I8042_KBD_PHYS_DESC, sizeof(serio->phys));
-       strlcpy(serio->firmware_id, i8042_kbd_firmware_id,
+       strscpy(serio->name, "i8042 KBD port", sizeof(serio->name));
+       strscpy(serio->phys, I8042_KBD_PHYS_DESC, sizeof(serio->phys));
+       strscpy(serio->firmware_id, i8042_kbd_firmware_id,
                sizeof(serio->firmware_id));
        set_primary_fwnode(&serio->dev, i8042_kbd_fwnode);
 
@@ -1371,15 +1371,15 @@ static int i8042_create_aux_port(int idx)
        serio->port_data        = port;
        serio->dev.parent       = &i8042_platform_device->dev;
        if (idx < 0) {
-               strlcpy(serio->name, "i8042 AUX port", sizeof(serio->name));
-               strlcpy(serio->phys, I8042_AUX_PHYS_DESC, sizeof(serio->phys));
-               strlcpy(serio->firmware_id, i8042_aux_firmware_id,
+               strscpy(serio->name, "i8042 AUX port", sizeof(serio->name));
+               strscpy(serio->phys, I8042_AUX_PHYS_DESC, sizeof(serio->phys));
+               strscpy(serio->firmware_id, i8042_aux_firmware_id,
                        sizeof(serio->firmware_id));
                serio->close = i8042_port_close;
        } else {
                snprintf(serio->name, sizeof(serio->name), "i8042 AUX%d port", idx);
                snprintf(serio->phys, sizeof(serio->phys), I8042_MUX_PHYS_DESC, idx + 1);
-               strlcpy(serio->firmware_id, i8042_aux_firmware_id,
+               strscpy(serio->firmware_id, i8042_aux_firmware_id,
                        sizeof(serio->firmware_id));
        }
 
index 59de8d9b6710e3400405a839d707e1859d241f98..04d2db982fb808c7b454d161187fd17cff4d6f7e 100644 (file)
@@ -199,8 +199,8 @@ static int olpc_apsp_probe(struct platform_device *pdev)
        kb_serio->close         = olpc_apsp_close;
        kb_serio->port_data     = priv;
        kb_serio->dev.parent    = &pdev->dev;
-       strlcpy(kb_serio->name, "sp keyboard", sizeof(kb_serio->name));
-       strlcpy(kb_serio->phys, "sp/serio0", sizeof(kb_serio->phys));
+       strscpy(kb_serio->name, "sp keyboard", sizeof(kb_serio->name));
+       strscpy(kb_serio->phys, "sp/serio0", sizeof(kb_serio->phys));
        priv->kbio              = kb_serio;
        serio_register_port(kb_serio);
 
@@ -216,8 +216,8 @@ static int olpc_apsp_probe(struct platform_device *pdev)
        pad_serio->close        = olpc_apsp_close;
        pad_serio->port_data    = priv;
        pad_serio->dev.parent   = &pdev->dev;
-       strlcpy(pad_serio->name, "sp touchpad", sizeof(pad_serio->name));
-       strlcpy(pad_serio->phys, "sp/serio1", sizeof(pad_serio->phys));
+       strscpy(pad_serio->name, "sp touchpad", sizeof(pad_serio->name));
+       strscpy(pad_serio->phys, "sp/serio1", sizeof(pad_serio->phys));
        priv->padio             = pad_serio;
        serio_register_port(pad_serio);
 
index 51b68501896c5782bac9dab312c47c690b6dce5d..0d54895428f5d554cf3983065f68469b959bb4ed 100644 (file)
@@ -169,7 +169,7 @@ static struct serio *parkbd_allocate_serio(void)
        if (serio) {
                serio->id.type = parkbd_mode;
                serio->write = parkbd_write;
-               strlcpy(serio->name, "PARKBD AT/XT keyboard adapter", sizeof(serio->name));
+               strscpy(serio->name, "PARKBD AT/XT keyboard adapter", sizeof(serio->name));
                snprintf(serio->phys, sizeof(serio->phys), "%s/serio0", parkbd_dev->port->name);
        }
 
index bedf75de0a2cec8a0c7ad4243fbfb0aac3407904..05878750f2c2d22eaeb59843fd13b109dafe3b15 100644 (file)
@@ -149,8 +149,8 @@ static int pcips2_probe(struct pci_dev *dev, const struct pci_device_id *id)
        serio->write            = pcips2_write;
        serio->open             = pcips2_open;
        serio->close            = pcips2_close;
-       strlcpy(serio->name, pci_name(dev), sizeof(serio->name));
-       strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys));
+       strscpy(serio->name, pci_name(dev), sizeof(serio->name));
+       strscpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys));
        serio->port_data        = ps2if;
        serio->dev.parent       = &dev->dev;
        ps2if->io               = serio;
index 9b02dd5dd2b99895c95db0739f56493aa1cfb397..bc1dc484389b40871476964d409652f660be4888 100644 (file)
@@ -449,8 +449,8 @@ static int ps2_gpio_probe(struct platform_device *pdev)
        serio->write = drvdata->write_enable ? ps2_gpio_write : NULL;
        serio->port_data = drvdata;
        serio->dev.parent = dev;
-       strlcpy(serio->name, dev_name(dev), sizeof(serio->name));
-       strlcpy(serio->phys, dev_name(dev), sizeof(serio->phys));
+       strscpy(serio->name, dev_name(dev), sizeof(serio->name));
+       strscpy(serio->phys, dev_name(dev), sizeof(serio->phys));
 
        drvdata->serio = serio;
        drvdata->dev = dev;
index 0071dd5ebcc27cca975a9c37ee48309041f598f2..902e81826fbfeab1094604172fe177858daec30e 100644 (file)
@@ -131,7 +131,7 @@ static int ps2mult_create_port(struct ps2mult *psm, int i)
        if (!serio)
                return -ENOMEM;
 
-       strlcpy(serio->name, "TQC PS/2 Multiplexer", sizeof(serio->name));
+       strscpy(serio->name, "TQC PS/2 Multiplexer", sizeof(serio->name));
        snprintf(serio->phys, sizeof(serio->phys),
                 "%s/port%d", mx_serio->phys, i);
        serio->id.type = SERIO_8042;
index bd248398556a8c5dceaa1787c02e81dfaf7ec82d..a1c61f5de0477626e138d68ca8235d627843bbab 100644 (file)
@@ -126,8 +126,8 @@ static int q40kbd_probe(struct platform_device *pdev)
        port->close = q40kbd_close;
        port->port_data = q40kbd;
        port->dev.parent = &pdev->dev;
-       strlcpy(port->name, "Q40 Kbd Port", sizeof(port->name));
-       strlcpy(port->phys, "Q40", sizeof(port->phys));
+       strscpy(port->name, "Q40 Kbd Port", sizeof(port->name));
+       strscpy(port->phys, "Q40", sizeof(port->phys));
 
        q40kbd_stop();
 
index 37fe6a5711ea0c48b49af979bbb98c544ff4a793..7008bc101415b3f47a42179b256aaae96cea0ae5 100644 (file)
@@ -128,8 +128,8 @@ static int rpckbd_probe(struct platform_device *dev)
        serio->close            = rpckbd_close;
        serio->dev.parent       = &dev->dev;
        serio->port_data        = rpckbd;
-       strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name));
-       strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys));
+       strscpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name));
+       strscpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys));
 
        platform_set_drvdata(dev, serio);
        serio_register_port(serio);
index 68fac4801e2e25a031a75e934286214e39fa7771..2724c3aa512cebdbe766633c7639d270ccbb1be3 100644 (file)
@@ -267,8 +267,8 @@ static int ps2_probe(struct sa1111_dev *dev)
        serio->write            = ps2_write;
        serio->open             = ps2_open;
        serio->close            = ps2_close;
-       strlcpy(serio->name, dev_name(&dev->dev), sizeof(serio->name));
-       strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys));
+       strscpy(serio->name, dev_name(&dev->dev), sizeof(serio->name));
+       strscpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys));
        serio->port_data        = ps2if;
        serio->dev.parent       = &dev->dev;
        ps2if->io               = serio;
index 669a728095b8bba77e1a24e41f740e3d4081e18e..7f7ef0e3a7494a39f0885a0e865633b664d9bf69 100644 (file)
@@ -171,7 +171,7 @@ static ssize_t serport_ldisc_read(struct tty_struct * tty, struct file * file,
        if (!serio)
                return -ENOMEM;
 
-       strlcpy(serio->name, "Serial port", sizeof(serio->name));
+       strscpy(serio->name, "Serial port", sizeof(serio->name));
        snprintf(serio->phys, sizeof(serio->phys), "%s/serio0", tty_name(tty));
        serio->id = serport->id;
        serio->id.type = SERIO_RS232;
index f15ed3dcdb9b2074f29a300497008377cf435d78..eb262640192e989e5d1966dc7f155443cfe62248 100644 (file)
@@ -256,8 +256,8 @@ static int sun4i_ps2_probe(struct platform_device *pdev)
        serio->close = sun4i_ps2_close;
        serio->port_data = drvdata;
        serio->dev.parent = dev;
-       strlcpy(serio->name, dev_name(dev), sizeof(serio->name));
-       strlcpy(serio->phys, dev_name(dev), sizeof(serio->phys));
+       strscpy(serio->name, dev_name(dev), sizeof(serio->name));
+       strscpy(serio->phys, dev_name(dev), sizeof(serio->phys));
 
        /* shutoff interrupt */
        writel(0, drvdata->reg_base + PS2_REG_GCTL);
index 56c7e471ac32eda41815070d9fdfc4a5f3c78c6b..80e06727464dad913982866fdc23a82c69f26ede 100644 (file)
@@ -155,7 +155,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
        acecad->input = input_dev;
 
        if (dev->manufacturer)
-               strlcpy(acecad->name, dev->manufacturer, sizeof(acecad->name));
+               strscpy(acecad->name, dev->manufacturer, sizeof(acecad->name));
 
        if (dev->product) {
                if (dev->manufacturer)
index 6d58443bb3e9863bd40e147b5e8b207fb1b2be86..e492a0331b246a862e19dd5f50817406e773420b 100644 (file)
@@ -356,7 +356,7 @@ static int hanwang_probe(struct usb_interface *intf, const struct usb_device_id
        usb_make_path(dev, hanwang->phys, sizeof(hanwang->phys));
        strlcat(hanwang->phys, "/input0", sizeof(hanwang->phys));
 
-       strlcpy(hanwang->name, hanwang->features->name, sizeof(hanwang->name));
+       strscpy(hanwang->name, hanwang->features->name, sizeof(hanwang->name));
        input_dev->name = hanwang->name;
        input_dev->phys = hanwang->phys;
        usb_to_input_id(dev, &input_dev->id);
index c608ac505d1ba77c86a21de5b4fc8be29ade2d21..d836d3dcc6a2491905535f0c8fcab35d5ae6b541 100644 (file)
@@ -319,7 +319,7 @@ static int pegasus_probe(struct usb_interface *intf,
        pegasus->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 
        if (dev->manufacturer)
-               strlcpy(pegasus->name, dev->manufacturer,
+               strscpy(pegasus->name, dev->manufacturer,
                        sizeof(pegasus->name));
 
        if (dev->product) {
index 4eedea08b0b5fd1826c56d486ad02849fdec78d9..ccecd1441f0bec1c59a4d1d8567a286df8b6de77 100644 (file)
@@ -2497,8 +2497,8 @@ static int mxt_vidioc_querycap(struct file *file, void *priv,
 {
        struct mxt_data *data = video_drvdata(file);
 
-       strlcpy(cap->driver, "atmel_mxt_ts", sizeof(cap->driver));
-       strlcpy(cap->card, "atmel_mxt_ts touch", sizeof(cap->card));
+       strscpy(cap->driver, "atmel_mxt_ts", sizeof(cap->driver));
+       strscpy(cap->card, "atmel_mxt_ts touch", sizeof(cap->card));
        snprintf(cap->bus_info, sizeof(cap->bus_info),
                 "I2C:%s", dev_name(&data->client->dev));
        return 0;
@@ -2514,11 +2514,11 @@ static int mxt_vidioc_enum_input(struct file *file, void *priv,
 
        switch (i->index) {
        case MXT_V4L_INPUT_REFS:
-               strlcpy(i->name, "Mutual Capacitance References",
+               strscpy(i->name, "Mutual Capacitance References",
                        sizeof(i->name));
                break;
        case MXT_V4L_INPUT_DELTAS:
-               strlcpy(i->name, "Mutual Capacitance Deltas", sizeof(i->name));
+               strscpy(i->name, "Mutual Capacitance Deltas", sizeof(i->name));
                break;
        }
 
index 5fb441387fe5a22feb6f3552a0435d9c0955a358..9ac1378610bc13d8bcbec7efdfe2deac90bd5ac4 100644 (file)
@@ -912,8 +912,8 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
                p = strchr(rdbuf, '*');
                if (p)
                        *p++ = '\0';
-               strlcpy(model_name, rdbuf + 1, EDT_NAME_LEN);
-               strlcpy(fw_version, p ? p : "", EDT_NAME_LEN);
+               strscpy(model_name, rdbuf + 1, EDT_NAME_LEN);
+               strscpy(fw_version, p ? p : "", EDT_NAME_LEN);
        } else if (!strncasecmp(rdbuf, "EP0", 3)) {
                tsdata->version = EDT_M12;
 
@@ -926,8 +926,8 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
                p = strchr(rdbuf, '*');
                if (p)
                        *p++ = '\0';
-               strlcpy(model_name, rdbuf, EDT_NAME_LEN);
-               strlcpy(fw_version, p ? p : "", EDT_NAME_LEN);
+               strscpy(model_name, rdbuf, EDT_NAME_LEN);
+               strscpy(fw_version, p ? p : "", EDT_NAME_LEN);
        } else {
                /* If it is not an EDT M06/M12 touchscreen, then the model
                 * detection is a bit hairy. The different ft5x06
@@ -945,7 +945,7 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
                if (error)
                        return error;
 
-               strlcpy(fw_version, rdbuf, 2);
+               strscpy(fw_version, rdbuf, 2);
 
                error = edt_ft5x06_ts_readwrite(client, 1, "\xA8",
                                                1, rdbuf);
@@ -981,7 +981,7 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
                                                        1, rdbuf);
                        if (error)
                                return error;
-                       strlcpy(fw_version, rdbuf, 1);
+                       strscpy(fw_version, rdbuf, 1);
                        snprintf(model_name, EDT_NAME_LEN,
                                 "EVERVISION-FT5726NEi");
                        break;
index 12f2562b0141b318dbc3a5f363a5399cb3972593..8ddb3f7d307aa484907d175559a1b90d6af8771c 100644 (file)
@@ -939,8 +939,8 @@ static int sur40_vidioc_querycap(struct file *file, void *priv,
 {
        struct sur40_state *sur40 = video_drvdata(file);
 
-       strlcpy(cap->driver, DRIVER_SHORT, sizeof(cap->driver));
-       strlcpy(cap->card, DRIVER_LONG, sizeof(cap->card));
+       strscpy(cap->driver, DRIVER_SHORT, sizeof(cap->driver));
+       strscpy(cap->card, DRIVER_LONG, sizeof(cap->card));
        usb_make_path(sur40->usbdev, cap->bus_info, sizeof(cap->bus_info));
        return 0;
 }
@@ -952,7 +952,7 @@ static int sur40_vidioc_enum_input(struct file *file, void *priv,
                return -EINVAL;
        i->type = V4L2_INPUT_TYPE_TOUCH;
        i->std = V4L2_STD_UNKNOWN;
-       strlcpy(i->name, "In-Cell Sensor", sizeof(i->name));
+       strscpy(i->name, "In-Cell Sensor", sizeof(i->name));
        i->capabilities = 0;
        return 0;
 }
index 3dda6eaabdab82721c844c8a18ec1f6cf6fb8fc8..d6d04b9f04fc1cb272c67f3968556d1e8024cd08 100644 (file)
@@ -1708,7 +1708,7 @@ static int usbtouch_probe(struct usb_interface *intf,
        usbtouch->input = input_dev;
 
        if (udev->manufacturer)
-               strlcpy(usbtouch->name, udev->manufacturer, sizeof(usbtouch->name));
+               strscpy(usbtouch->name, udev->manufacturer, sizeof(usbtouch->name));
 
        if (udev->product) {
                if (udev->manufacturer)
index 691285ace2289f83f0f270ba091e58bc8ef718d9..928c5ee3ac36c2b5764df5d255f1fc18274c5982 100644 (file)
@@ -625,7 +625,7 @@ static int w8001_connect(struct serio *serio, struct serio_driver *drv)
        /* For backwards-compatibility we compose the basename based on
         * capabilities and then just append the tool type
         */
-       strlcpy(basename, "Wacom Serial", sizeof(basename));
+       strscpy(basename, "Wacom Serial", sizeof(basename));
 
        err_pen = w8001_setup_pen(w8001, basename, sizeof(basename));
        err_touch = w8001_setup_touch(w8001, basename, sizeof(basename));
@@ -635,7 +635,7 @@ static int w8001_connect(struct serio *serio, struct serio_driver *drv)
        }
 
        if (!err_pen) {
-               strlcpy(w8001->pen_name, basename, sizeof(w8001->pen_name));
+               strscpy(w8001->pen_name, basename, sizeof(w8001->pen_name));
                strlcat(w8001->pen_name, " Pen", sizeof(w8001->pen_name));
                input_dev_pen->name = w8001->pen_name;
 
@@ -651,7 +651,7 @@ static int w8001_connect(struct serio *serio, struct serio_driver *drv)
        }
 
        if (!err_touch) {
-               strlcpy(w8001->touch_name, basename, sizeof(w8001->touch_name));
+               strscpy(w8001->touch_name, basename, sizeof(w8001->touch_name));
                strlcat(w8001->touch_name, " Finger",
                        sizeof(w8001->touch_name));
                input_dev_touch->name = w8001->touch_name;