Commit 580d2f45 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: Changes to core/config.c (3 of 9)

This patch includes a bunch of little local improvements to the code,
listed in the patch comments.  There are only two notable changes.  If a
device has more configurations than our maximum, the code doesn't reject
the device but simply parses as many configurations as it can and ignores
the rest.  Likewise, if a configuration contains too many interfaces, the
code parses as many as it can and skips the excess.  That way such devices
will be at least partially useable.  Since these limits are arbitrary and
set by the implementation (not part of the USB spec), it doesn't make
sense to reject a device that violates them.

 Numerous local programming improvements:
   Don't initialize to 0 fields in structures that have been memset to 0.
   Don't constantly keep track of how many bytes are parsed.
   Use local variables to hold unwieldy values.
   Remove redundant tests.
   Allow devices to have more configurations or interfaces than we can handle.
parent 8fc9363d
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment