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

Configure Feed

Select the types of activity you want to include in your feed.

Input: wacom_w8001 - simplify device name generation

Replace pairs of strscpy/strlcat calls with snprintf.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Link: https://lore.kernel.org/r/CANRwn3SuTjdCCK4YH1ObvsC_gZuythAQ7kSHJP-CiAFw9h5Qcw@mail.gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jason Gerecke and committed by
Dmitry Torokhov
6c7cc1a2 6f47c7ae

+5 -8
+5 -8
drivers/input/touchscreen/wacom_w8001.c
··· 595 595 struct w8001 *w8001; 596 596 struct input_dev *input_dev_pen; 597 597 struct input_dev *input_dev_touch; 598 - char basename[64]; 598 + char basename[64] = "Wacom Serial"; 599 599 int err, err_pen, err_touch; 600 600 601 601 w8001 = kzalloc(sizeof(struct w8001), GFP_KERNEL); ··· 625 625 /* For backwards-compatibility we compose the basename based on 626 626 * capabilities and then just append the tool type 627 627 */ 628 - strscpy(basename, "Wacom Serial", sizeof(basename)); 629 - 630 628 err_pen = w8001_setup_pen(w8001, basename, sizeof(basename)); 631 629 err_touch = w8001_setup_touch(w8001, basename, sizeof(basename)); 632 630 if (err_pen && err_touch) { ··· 633 635 } 634 636 635 637 if (!err_pen) { 636 - strscpy(w8001->pen_name, basename, sizeof(w8001->pen_name)); 637 - strlcat(w8001->pen_name, " Pen", sizeof(w8001->pen_name)); 638 + snprintf(w8001->pen_name, sizeof(w8001->pen_name), 639 + "%s Pen", basename); 638 640 input_dev_pen->name = w8001->pen_name; 639 641 640 642 w8001_set_devdata(input_dev_pen, w8001, serio); ··· 649 651 } 650 652 651 653 if (!err_touch) { 652 - strscpy(w8001->touch_name, basename, sizeof(w8001->touch_name)); 653 - strlcat(w8001->touch_name, " Finger", 654 - sizeof(w8001->touch_name)); 654 + snprintf(w8001->pen_name, sizeof(w8001->pen_name), 655 + "%s Finger", basename); 655 656 input_dev_touch->name = w8001->touch_name; 656 657 657 658 w8001_set_devdata(input_dev_touch, w8001, serio);