All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shihuang Liu <shlomojune6@gmail.com>
To: linux-input@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Marcus Folkesson <marcus.folkesson@gmail.com>,
	Ville Syrjala <syrjala@sci.fi>,
	Henk Vergonet <Henk.Vergonet@gmail.com>,
	Henrik Rydberg <rydberg@bitmath.org>,
	Alejandro Colomar <alx+linux-hardening@kernel.org>,
	Shihuang Liu <shlomojune6@gmail.com>
Subject: [PATCH v2 RESEND 6/6] Input: touchscreen - use usb_make_subpath()
Date: Thu, 22 Oct 2026 15:09:29 +0800	[thread overview]
Message-ID: <20261022070929.20820-7-shlomojune6@gmail.com> (raw)
In-Reply-To: <20261022070929.20820-1-shlomojune6@gmail.com>

The sur40 and usbtouchscreen 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@gmail.com>
---
 drivers/input/touchscreen/sur40.c          | 3 +--
 drivers/input/touchscreen/usbtouchscreen.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index 77ec2c94b91fd..7702eead123e2 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -690,8 +690,7 @@ static int sur40_probe(struct usb_interface *interface,
 	/* Set up regular input device structure */
 	input->name = DRIVER_LONG;
 	usb_to_input_id(usbdev, &input->id);
-	usb_make_path(usbdev, sur40->phys, sizeof(sur40->phys));
-	strlcat(sur40->phys, "/input0", sizeof(sur40->phys));
+	usb_make_subpath(usbdev, sur40->phys, sizeof(sur40->phys), "input0");
 	input->phys = sur40->phys;
 	input->dev.parent = &interface->dev;
 
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
index 0bbacb517c286..fd2b896675dee 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -1512,8 +1512,7 @@ static int usbtouch_probe(struct usb_interface *intf,
 			 le16_to_cpu(udev->descriptor.idVendor),
 			 le16_to_cpu(udev->descriptor.idProduct));
 
-	usb_make_path(udev, usbtouch->phys, sizeof(usbtouch->phys));
-	strlcat(usbtouch->phys, "/input0", sizeof(usbtouch->phys));
+	usb_make_subpath(udev, usbtouch->phys, sizeof(usbtouch->phys), "input0");
 
 	input_dev->name = usbtouch->name;
 	input_dev->phys = usbtouch->phys;
-- 
2.43.0


  parent reply	other threads:[~2026-10-22  7:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 12:31 [PATCH v2 0/6] USB: add usb_make_subpath() to replace strlcat() in input drivers Shihuang Liu
2026-10-21 12:31 ` [PATCH v2 1/6] USB: add usb_make_subpath() for formatted device subpaths Shihuang Liu
2026-10-21 13:17   ` Alejandro Colomar
2026-10-22  7:08     ` Shihuang Liu
2026-10-22  9:59       ` Alejandro Colomar
2026-10-21 15:20   ` Greg KH
2026-10-22  6:49     ` Shihuang Liu
2026-10-21 12:31 ` [PATCH v2 2/6] Input: joystick - use usb_make_subpath() Shihuang Liu
2026-10-21 13:21   ` Alejandro Colomar
2026-10-21 17:00     ` Dmitry Torokhov
2026-10-21 17:20       ` Alejandro Colomar
2026-10-22  7:36     ` Shihuang Liu
2026-10-22 10:03       ` Alejandro Colomar
2026-10-21 12:31 ` [PATCH v2 3/6] Input: misc " Shihuang Liu
2026-10-21 12:31 ` [PATCH v2 4/6] Input: mouse " Shihuang Liu
2026-10-21 12:31 ` [PATCH v2 5/6] Input: tablet " Shihuang Liu
2026-10-21 12:31 ` [PATCH v2 6/6] Input: touchscreen " Shihuang Liu
2026-10-22  7:09 ` [PATCH v2 RESEND 0/6] USB: add usb_make_subpath() to replace strlcat() in input drivers Shihuang Liu
2026-10-22  7:09   ` [PATCH v2 RESEND 1/6] USB: add usb_make_subpath() for formatted device subpaths Shihuang Liu
2026-10-22  7:14     ` sashiko-bot
2026-10-22  7:09   ` [PATCH v2 RESEND 2/6] Input: joystick - use usb_make_subpath() Shihuang Liu
2026-10-22  7:12     ` sashiko-bot
2026-10-22  7:09   ` [PATCH v2 RESEND 3/6] Input: misc " Shihuang Liu
2026-10-22  7:12     ` sashiko-bot
2026-10-22  7:09   ` [PATCH v2 RESEND 4/6] Input: mouse " Shihuang Liu
2026-10-22  7:12     ` sashiko-bot
2026-10-22  7:09   ` [PATCH v2 RESEND 5/6] Input: tablet " Shihuang Liu
2026-10-22  7:12     ` sashiko-bot
2026-10-22  7:09   ` Shihuang Liu [this message]
2026-10-22  7:12     ` [PATCH v2 RESEND 6/6] Input: touchscreen " sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261022070929.20820-7-shlomojune6@gmail.com \
    --to=shlomojune6@gmail.com \
    --cc=Henk.Vergonet@gmail.com \
    --cc=alx+linux-hardening@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marcus.folkesson@gmail.com \
    --cc=rydberg@bitmath.org \
    --cc=syrjala@sci.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.