This squashes "warning: comparison between pointer and zero character"
This was an empty string check that was checking the pointer rather
than the first character. The check was done correctly before the
string was used, so here we yank the correct check up, to the upper
level, replacing the ineffectual/broken one.
Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
These descriptor definitions descibe how raw descriptor data
should be interpreted.
Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This adds a new way of dumping descriptors. It takes the descriptor
data to be dumped, and a descriptor definition as input.
The descriptor definition takes the form of a NULL terminated array
of descriptor field definitions.
These definitions describe how the raw descriptor data buffer should
be interpreted.
Thus the knowledge of how to interpret a descriptor buffer is separate
from the shared code that renders the descriptor dump. This has two
advantages:
1. The code for dumping descriptors is common, so the output is easy
to keep consistent. It is also consistent and thorough in its
handling of insufficient descriptor data buffer, and junk data
at the end of a descriptor.
2. It is easy to add support for new descriptors, since they are now
simple definitions that resemble the tables in the USB specifications.
Signed-off-by: Michael Drake <michael.drake@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>