[PATCH v2 5/6] Input: tablet - use usb_make_subpath()
From: Shihuang Liu
Date: Wed Oct 21 2026 - 08:39:32 EST
The acecad, aiptek, hanwang, kbtab and pegasus_notetaker drivers build
their input device physical paths by appending "/input0" with strlcat()
after usb_make_path().
In preparation for removing the deprecated strlcat() API [1], replace
each pair of calls with usb_make_subpath(). The helper formats the USB
path and the "input0" subpath in one call, avoiding a separate buffer
scan and append operation.
Link: https://github.com/KSPP/linux/issues/370 [1]
Signed-off-by: Shihuang Liu <shlomojune6@xxxxxxxxx>
---
drivers/input/tablet/acecad.c | 3 +--
drivers/input/tablet/aiptek.c | 6 ++----
drivers/input/tablet/hanwang.c | 3 +--
drivers/input/tablet/kbtab.c | 3 +--
drivers/input/tablet/pegasus_notetaker.c | 3 +--
5 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/input/tablet/acecad.c b/drivers/input/tablet/acecad.c
index ba79dff21aac8..c12b0a0181837 100644
--- a/drivers/input/tablet/acecad.c
+++ b/drivers/input/tablet/acecad.c
@@ -160,8 +160,7 @@ static int usb_acecad_probe(struct usb_interface *intf, const struct usb_device_
strlcat(acecad->name, dev->product, sizeof(acecad->name));
}
- usb_make_path(dev, acecad->phys, sizeof(acecad->phys));
- strlcat(acecad->phys, "/input0", sizeof(acecad->phys));
+ usb_make_subpath(dev, acecad->phys, sizeof(acecad->phys), "input0");
input_dev->name = acecad->name;
input_dev->phys = acecad->phys;
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index 0c1acb9e6b437..cc68ee82c12c3 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -1705,10 +1705,8 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
* & a tablet, and the inputX number actually will tell
* us something...
*/
- usb_make_path(usbdev, aiptek->features.usbPath,
- sizeof(aiptek->features.usbPath));
- strlcat(aiptek->features.usbPath, "/input0",
- sizeof(aiptek->features.usbPath));
+ usb_make_subpath(usbdev, aiptek->features.usbPath,
+ sizeof(aiptek->features.usbPath), "input0");
/* Set up client data, pointers to open and close routines
* for the input device.
diff --git a/drivers/input/tablet/hanwang.c b/drivers/input/tablet/hanwang.c
index fd5a7e761dcc4..a9521bbc89646 100644
--- a/drivers/input/tablet/hanwang.c
+++ b/drivers/input/tablet/hanwang.c
@@ -350,8 +350,7 @@ static int hanwang_probe(struct usb_interface *intf, const struct usb_device_id
hanwang->usbdev = dev;
hanwang->dev = input_dev;
- usb_make_path(dev, hanwang->phys, sizeof(hanwang->phys));
- strlcat(hanwang->phys, "/input0", sizeof(hanwang->phys));
+ usb_make_subpath(dev, hanwang->phys, sizeof(hanwang->phys), "input0");
strscpy(hanwang->name, hanwang->features->name, sizeof(hanwang->name));
input_dev->name = hanwang->name;
diff --git a/drivers/input/tablet/kbtab.c b/drivers/input/tablet/kbtab.c
index 6ce70c8e2d7cc..f777118ed7c8f 100644
--- a/drivers/input/tablet/kbtab.c
+++ b/drivers/input/tablet/kbtab.c
@@ -137,8 +137,7 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i
kbtab->intf = intf;
kbtab->dev = input_dev;
- usb_make_path(dev, kbtab->phys, sizeof(kbtab->phys));
- strlcat(kbtab->phys, "/input0", sizeof(kbtab->phys));
+ usb_make_subpath(dev, kbtab->phys, sizeof(kbtab->phys), "input0");
input_dev->name = "KB Gear Tablet";
input_dev->phys = kbtab->phys;
diff --git a/drivers/input/tablet/pegasus_notetaker.c b/drivers/input/tablet/pegasus_notetaker.c
index 85390ae423076..28fbae98f7399 100644
--- a/drivers/input/tablet/pegasus_notetaker.c
+++ b/drivers/input/tablet/pegasus_notetaker.c
@@ -354,8 +354,7 @@ static int pegasus_probe(struct usb_interface *intf,
le16_to_cpu(dev->descriptor.idVendor),
le16_to_cpu(dev->descriptor.idProduct));
- usb_make_path(dev, pegasus->phys, sizeof(pegasus->phys));
- strlcat(pegasus->phys, "/input0", sizeof(pegasus->phys));
+ usb_make_subpath(dev, pegasus->phys, sizeof(pegasus->phys), "input0");
INIT_WORK(&pegasus->init, pegasus_init);
--
2.43.0