From: Marco Felsch <m.felsch@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] usb: gadget: initialize serialnumber as empty string
Date: Thu, 26 Oct 2023 16:31:42 +0200 [thread overview]
Message-ID: <20231026143142.6dlijrwabwgj4kfb@pengutronix.de> (raw)
In-Reply-To: <2e8afb0f-8ac4-575e-3029-9c1fffdb71fc@pengutronix.de>
On 23-10-26, Ahmad Fatoum wrote:
> Hello Marco,
>
> On 26.10.23 14:46, Marco Felsch wrote:
> > Windows hosts do require the serial number to be set to any ascii string
> > to enumerate correctly. Set the serial number to "empty" to provide a
> > sane default which works for both hosts. Users can still override this
> > via the gadget.serialnumber variable.
> >
> > Reported-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > ---
> > drivers/usb/gadget/udc/core.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
> > index b58498680ad1..dc5d1daa14bf 100644
> > --- a/drivers/usb/gadget/udc/core.c
> > +++ b/drivers/usb/gadget/udc/core.c
> > @@ -1204,7 +1204,7 @@ int usb_add_gadget(struct usb_gadget *gadget)
> > gadget->productname = xstrdup(barebox_get_model());
> > dev_add_param_string(&gadget->dev, "productname", NULL, NULL,
> > &gadget->productname, NULL);
> > - gadget->serialnumber = xstrdup("");
> > + gadget->serialnumber = xstrdup("empty");
>
> Given that we initialize productname to model, it makes sense to initialize
> serialnumber to global.serial_number now that we have that generic variable.
>
> If that's unset, you can use a fixed value, I'd prefer "unset" though
> instead of "empty".
I will adapt it, thanks.
Regards,
Marco
prev parent reply other threads:[~2023-10-26 14:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-26 12:46 Marco Felsch
2023-10-26 12:46 ` [PATCH 2/2] scripts: get_maintainers: drop --status enforcement Marco Felsch
2023-10-26 14:21 ` Ahmad Fatoum
2023-10-26 14:27 ` Marco Felsch
2023-10-26 14:29 ` Ahmad Fatoum
2023-10-26 14:34 ` Marco Felsch
2023-10-26 21:30 ` Ahmad Fatoum
2023-10-26 14:18 ` [PATCH 1/2] usb: gadget: initialize serialnumber as empty string Ahmad Fatoum
2023-10-26 14:31 ` Marco Felsch [this message]
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=20231026143142.6dlijrwabwgj4kfb@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.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