summaryrefslogtreecommitdiffstats
path: root/net/packet
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2020-09-28 11:20:50 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-02 11:28:59 +0200
commit19502e6911e4ef4a036344eed36274bb18225033 (patch)
tree966c76749dd0fa3f4daa8a9a7b517b280e7e4773 /net/packet
parent59ee364bafb2690ebdd1ea5793c2fdb2ea27433a (diff)
downloadlinux-stable-19502e6911e4ef4a036344eed36274bb18225033.tar.gz
linux-stable-19502e6911e4ef4a036344eed36274bb18225033.tar.bz2
linux-stable-19502e6911e4ef4a036344eed36274bb18225033.zip
USB: hub: Clean up use of port initialization schemes and retries
The SET_CONFIG_TRIES macro in hub.c is badly named; it controls the number of port-initialization retry attempts rather than the number of Set-Configuration attempts. Furthermore, the USE_NEW_SCHEME macro and use_new_scheme() function are written in a very confusing manner, making it almost impossible to figure out exactly what they do or check that they are correct. This patch renames SET_CONFIG_TRIES to PORT_INIT_TRIES, removes USE_NEW_SCHEME entirely, and rewrites use_new_scheme() to be much more transparent, with added comments explaining how it works. The patch also pulls the single call site of use_new_scheme() out from the Get-Descriptor retry loop (where it returns the same value each time) and renames the local variable used to store the result. The overall effect is a minor cleanup. However, there is one functional change: If the "use_both_schemes" module parameter isn't set (by default it is set), the existing code does only two retry iterations. After this patch it will always perform four, regardless of the parameter's value. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Link: https://lore.kernel.org/r/20200928152050.GA134701@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/packet')
0 files changed, 0 insertions, 0 deletions