lsusb: Squash Wpointer-compare warning.

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>
This commit is contained in:
Michael Drake 2017-12-07 17:07:18 +00:00 committed by Greg Kroah-Hartman
parent 977f8f8773
commit 969054759a

View File

@ -64,17 +64,16 @@ static void desc_bmcontrol_dump(
(type == DESC_BMCONTROL_2));
while (strings[count] != NULL) {
if (strings[0] != '\0') {
if (strings[count][0] != '\0') {
if (type == DESC_BMCONTROL_1) {
if ((strings[count][0] != '\0') &&
(bmcontrols >> count) & 0x1) {
if ((bmcontrols >> count) & 0x1) {
printf("%*s%s Control\n",
indent * 2, "",
strings[count]);
}
} else {
control = (bmcontrols >> (count * 2)) & 0x3;
if ((strings[count][0] != '\0') && control) {
if (control) {
printf("%*s%s Control (%s)\n",
indent * 2, "",
strings[count],