Linux USB
 help / color / mirror / Atom feed
From: Crescent Hsieh <crescentcy.hsieh@moxa.com>
To: Johan Hovold <johan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	FangpingFP.Cheng@moxa.com, Epson.Chiang@moxa.com
Subject: Re: [PATCH v2 1/4] USB: serial: mxuport: clean up firmware version handling
Date: Mon, 27 Jul 2026 18:27:43 +0800	[thread overview]
Message-ID: <amcyn2CmU5ThICTd@moxa-ThinkCentre-M90t> (raw)
In-Reply-To: <al-DXpI52HuWBNwG@hovoldconsulting.com>

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@iscas.ac.cn/
>
> 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

  reply	other threads:[~2026-07-27 10:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23  8:01 [PATCH v2 0/4] USB: serial: mxuport: add MUX50U support and updates Crescent Hsieh
2026-06-23  8:01 ` [PATCH v2 1/4] USB: serial: mxuport: clean up firmware version handling Crescent Hsieh
2026-07-21 14:34   ` Johan Hovold
2026-07-27 10:27     ` Crescent Hsieh [this message]
2026-06-23  8:01 ` [PATCH v2 2/4] USB: serial: mxuport: add MUX50U-based device support Crescent Hsieh
2026-07-21 14:59   ` Johan Hovold
2026-07-27 10:27     ` Crescent Hsieh
2026-08-03  7:08       ` Johan Hovold
2026-06-23  8:01 ` [PATCH v2 3/4] USB: serial: mxuport: handle SEND_NEXT transmit flow control Crescent Hsieh
2026-07-21 15:51   ` Johan Hovold
2026-07-27 10:28     ` Crescent Hsieh
2026-08-03  8:35       ` Johan Hovold
2026-06-23  8:01 ` [PATCH v2 4/4] USB: serial: mxuport: support RS485 mode configuration Crescent Hsieh

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=amcyn2CmU5ThICTd@moxa-ThinkCentre-M90t \
    --to=crescentcy.hsieh@moxa.com \
    --cc=Epson.Chiang@moxa.com \
    --cc=FangpingFP.Cheng@moxa.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox