Re: [PATCH v2 1/4] USB: serial: mxuport: clean up firmware version handling
From: Crescent Hsieh
Date: Mon Jul 27 2026 - 06:28:59 EST
On Tue, Jul 21, 2026 at 04:34:06PM +0200, Johan Hovold wrote:
> On Tue, Jun 23, 2026 at 04:01:36PM +0800, Crescent Hsieh wrote:
>
> Thanks for the v2. You seem to have addressed all my comments on v1 of
> the series, which is unfortunately not as common as I wish it were. :)
Thanks for your review comments as well. I'm glad to hear that. I just
want to get things right and keep the code clean, even if it takes some
time. :)
> > @@ -970,8 +982,32 @@ static int mxuport_calc_num_ports(struct usb_serial *serial,
> > return num_ports;
> > }
> >
> > +static void mxuport_set_fw_version(struct mxuport_fw_version *version,
> > + u8 major, u8 minor, u8 build)
>
> The naming is a bit unfortunate as this is not an inverse of
> mxuport_get_fw_version() but that should be ok.
Agreed. mxuport_get_fw_version() retrieves the firmware version from the
device, whereas this helper composes a local version representation from
its major, minor and build components. I will rename it to
mxuport_compose_fw_version().
> > +{
> > + version->major = major;
> > + version->minor = minor;
> > + version->build = build;
> > + version->value = (major << 16) | (minor << 8) | build;
> > +}
> > +
> > +static int mxuport_parse_fw_version(const struct firmware *fw,
> > + const u16 *offsets,
> > + struct mxuport_fw_version *version)
> > +{
> > + if (fw->size <= offsets[0] || fw->size <= offsets[1] ||
> > + fw->size <= offsets[2])
> > + return -EINVAL;
>
> I just merged this sanity check:
>
> https://lore.kernel.org/all/20260715084611.45995-1-pengpeng@xxxxxxxxxxx/
>
> so you may want to rebase on my usb-linus branch if there is a v3,
> otherwise I can fix it up.
>
> https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial.git/log/?h=usb-linus
Okay, I will rebase v3 onto your usb-linus branch and resolve the
conflict before resubmitting.
---
Sincerely,
Crescent Hsieh