Re: [PATCH v2 2/6] Input: joystick - use usb_make_subpath()
From: Alejandro Colomar
Date: Wed Oct 21 2026 - 13:25:56 EST
Hi Dmitry,
> Date: 2026-10-21 10:00:26-0700
> From: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
>
[...]
> > > - usb_make_path(udev, pxrc->phys, sizeof(pxrc->phys));
> > > - strlcat(pxrc->phys, "/input0", sizeof(pxrc->phys));
> > > + usb_make_subpath(udev, pxrc->phys, sizeof(pxrc->phys), "input0");
> >
> > To be honest, I think the composed approach is more readable. You don't
> > need to learn a new _subpath function with all the details it has.
> >
> > Everyone knows what a str*cat() (or str*cpy, FWIW) function does.
> >
> > I'd rather improve this by adding strscat(). The reason for removing
> > strlcat(3) is that it is vulnerable to DoS, and that it is inefficient,
> > but it is good at producing readable code, and a replacement should not
> > degrade that.
>
> Well, there is absolutely no performance concerns in this code, so
> another option is to simply leave it as is. I see no benefit here from
> using yet another variant of str*cat().
LGTM.
Have a lovely night!
Alex
>
> Thanks.
>
> --
> Dmitry
--
<https://www.alejandro-colomar.es>
Attachment:
signature.asc
Description: PGP signature