From: Ben Leslie <benno@benno.id.au>
To: qemu-devel@nongnu.org
Subject: What is the intended behaviour of usb_host_get_port for root hubs?
Date: Tue, 9 Mar 2021 10:54:15 +1100 [thread overview]
Message-ID: <CABZ0LtCh37eXx0evxYNsZigFJgq-RY+wdFvA0SMDH4HgxpK-zw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 996 bytes --]
When usb_host_get_port is called for a root-hub device what string should
be output in the port parameter?
The current behaviour writes a string with whatever stack value happened to
be in the paths stack array.
Possible behaviours that I can see being useful are:
1: Don't modify the port parameter.
2: Write an empty string.
My preference would be for #2, but possibly #1 is intended. I can provide a
patch if someone can let me know the intended behaviour. If #1 is intended,
then I think the usage in hmp_info_usbhost might need changing as well. The
other usage in usb_host_auto_check where the provided port parameter is set
to "-" prior to calling the function; it's not clear what the intent of
that is. Finally, the function returns zero on error and string length on
success (which actually makes #2 a problem), however none of the callers
check the return value, so perhaps it can be made a void function? Or
possibly it should return -1 on error, rather than zero.
Regards,
Ben
[-- Attachment #2: Type: text/html, Size: 1220 bytes --]
next reply other threads:[~2021-03-08 23:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-08 23:54 Ben Leslie [this message]
2021-03-09 7:23 ` What is the intended behaviour of usb_host_get_port for root hubs? Gerd Hoffmann
2021-03-09 7:43 ` Ben Leslie
2021-03-09 9:43 ` Gerd Hoffmann
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=CABZ0LtCh37eXx0evxYNsZigFJgq-RY+wdFvA0SMDH4HgxpK-zw@mail.gmail.com \
--to=benno@benno.id.au \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).