From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.227.138 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792653019; b=UPcTj5GOoZijnNGYuHl0CnFZpP7W5zkCtMm7I/gM84xYdFf1JglnI/iJniYeVOH/WblZ 3sS6eVb/n3N0QKAI+bRXtnX7CGnUQNorJ+68xpqAAa+gTQknMKPedDjixguhYuPKQ6yCw Iz5GR6XNMLdD5N79ABlDSyEiHN4K5yJonsHaI9wAiYoLvda4azZnwLsrQ7MYOGcbCikAB w2d5Idl/HExNbQcml6M2OFHH1oXt0FYqSPHCH8y8LxPZ8XyKIEZXVJM+tHth9jAzlf2yu uj0IvYzx/OKyvOvoSUKY04yLWGuFZHA3+zR+MzuqQfSOmkpYdLslOkwCnuUTVI1gj3g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792653019; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=D0jGTVLtzaIFDc7gI7x4v6SVaJxQo+nXgqAY9AHPQIU=; b=P40FvFYV893ZehoQ7I67F2fbbkzaG8qfpkSjdkZBY0FbYav4lf07Nrs2k1PhqWsP7Pch 8q6MPQeIEi6dOH914YxlQSWutcNCmgd1gFMXVcDkNYqhrPK55vaMuLccR8m5SETlbZCcS OjqAXhSnOPQbm+M0d6QnrTWxeSfqtSFVBQx6AvA49wV4s0kxLnT7s2/u/p1rt6n+TV6y0 AGKnxmLujk8sGmTCj9mRJ7/H9fkU0cmkRSPMitOuZraD1vzCjunpQGhe5ODt/niEBGTSB tRBNlT/wAgXf5U1q67KJO5BkzQkjeodqyDOPtWGsKqhYIfX6QXag8M24Nj5vIQU4M4g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=kiOVV5e6; arc=none smtp.remote-ip=74.125.227.138 Received: from mail-pj2-f10.google.com (mail-pj2-f10.google.com [74.125.227.138]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2EA14606A31D for ; Thu, 22 Oct 2026 07:10:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2EA14606A31D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=kiOVV5e6 Received: by mail-pj2-f10.google.com with SMTP id 98e67ed59e1d1-3abe4821449so811454a91.1 for ; Thu, 22 Oct 2026 00:10:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792653018; x=1793257818; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=D0jGTVLtzaIFDc7gI7x4v6SVaJxQo+nXgqAY9AHPQIU=; b=kiOVV5e6J/GurhcFbB5U4EjybcgG1yzCdcXX6qqqH3B8pLf4zT2exbjzkKeu3AkOYG 8EQtoM6IijOclz7ZN+NIncP26KuaxJ7N+oPIIOX7hBIcv+ggvbWqc0diJmRQwwrOvOkV K1nu/SzFLysQ/vNIBbzqL3nJP6HzHiBXc/QTPIMFjM/XRDVc+9uKy4JrWsGJ/VXcAauC avfVAKZ3pJKSIk8FLonvgP9p16ZOpzTUbwSWm1ROEhgcbPkvIjW/Yg/jhy9zhVDLSozb udFqaQiSg9Q/PTrYCbTI5X34jL4OHBO9pFrN71nfLTVQwHw5oVidgelNT+DgEBwu91YE Y5Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792653018; x=1793257818; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=D0jGTVLtzaIFDc7gI7x4v6SVaJxQo+nXgqAY9AHPQIU=; b=uU0VIEhOj99Q3vBSrgvy6sg4l2yJCO6gpzhHcn1qAUJuDVjX7JMJ0n8HaXo5S3p8Z6 RwrzuIqrk9/0Yr8fV4fTVZAbazD4urQ6cOVZYd6+LYnrQ71NxIRtHmio6ljTaHnCML52 m8bt9n/d7ikKCh/2OZkM52GeivX61CHCJrZ/Qr4ik39r4M1lX7Fw5PCI47J4r78uYK8N f2YH1eyose3ioDlL8XzXxwznhPyELtd4Oh9e/ElZNwvxhHgd92Mt4HGZ3WE6VroqCiFQ 4QtfCvR6N3HiJNNIFuAO2tG9J7RsXS3XfrIuxvojJEyYs7msjKM4fViWpxTfiZYf0JZY tW9Q== X-Forwarded-Encrypted: i=1; AKwUvBwVoIkncJxxcsSk8EVXRMqg7oNOnFmlrWZ6q73T+b9fwSwS2Hch5VPgkGhY62vP5O5GsCLr4rxMMU8=@vger.kernel.org X-Gm-Message-State: AFq9FYJF8bqWzN+sxK4fjU42TAW0eQj7lalse/CC650emy77z5/ocr6Y ws0h6YOTy27nBLfZu/TiKnUQWp1AHjVzNtBRxVa7ZDgdOcNxmOMITW2j X-Gm-Gg: AYBFou0Krphfd0y+XRRRotu2EIQ5wHz9qB+u+5o6rw2m4Wouw5LVVcQ5sEgmDGUsTEm op/+ykdWhgsChv9hfEdCjUj3QGXiwEn3GofDiKBd0oWYiZk9j7FAMdjfOcKiIk6k9GPnvJtP8Ll 9JAwvCEimIuprRj8knEFXKefMNM/gS3AWaVrkjV9yWHX4VE/1vcHpRMXzBc7EbvoHWQ1tilmOW2 xIrxqH1/CPbFrFFcVtYRCR63u9Pz9Q5GnCthzfdrOGnqdm0DRIXbI0u+8p26kqdRyqFnaRN81hk aRuAt6Pxex5gYPCTOxTbe033ioR6Xdfig8RlqZI3ldrBFzEYtJ0PXHE8UaJUUMaMBWV5YKxgOvq oyPrYSGa0G5HZa9FUA63ameZuAYmjeww+8I+P5uKfbPU+A2dLM25MjEIzhu2GLes+iuOVwLiGaK zOjHZV1o0VdFzI4FwAZjjaU27qrcvYSloRK1SsciPlPs4B/egvWBU1ZjahI7Yf1humWij9tiaEV EClv8CXs/pMy+4mBNzVwbi/NvhWHPtqv+JWPdQOx9hQF7EKFVOiAXi2AHOsbDt6IQl2XcGx5w== X-Received: by 2002:a05:6a21:4ead:b0:3e0:df21:9de5 with SMTP id adf61e73a8af0-3e287dbdaa0mr3277689637.35.1792653018511; Thu, 22 Oct 2026 00:10:18 -0700 (PDT) Received: from J4f-Laptop.localdomain ([183.36.237.113]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8a0894b49d1sm1706039b3a.12.2026.10.22.00.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2026 00:10:17 -0700 (PDT) From: Shihuang Liu 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 , Dmitry Torokhov , Marcus Folkesson , Ville Syrjala , Henk Vergonet , Henrik Rydberg , Alejandro Colomar , Shihuang Liu Subject: [PATCH v2 RESEND 5/6] Input: tablet - use usb_make_subpath() Date: Thu, 22 Oct 2026 15:09:28 +0800 Message-ID: <20261022070929.20820-6-shlomojune6@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261022070929.20820-1-shlomojune6@gmail.com> References: <20261021123146.17202-1-shlomojune6@gmail.com> <20261022070929.20820-1-shlomojune6@gmail.com> X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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