testusb: Fix warning comparing pointer to 0
authorHaowen Bai <baihaowen@meizu.com>
Thu, 24 Mar 2022 02:16:11 +0000 (10:16 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Apr 2022 11:32:49 +0000 (13:32 +0200)
Avoid pointer type value compared with 0 to make code clear.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1648088171-30912-1-git-send-email-baihaowen@meizu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/usb/testusb.c

index 69c3ead..474bae8 100644 (file)
@@ -482,7 +482,7 @@ usage:
        }
        if (not)
                return 0;
-       if (testdevs && testdevs->next == 0 && !device)
+       if (testdevs && !testdevs->next && !device)
                device = testdevs->name;
        for (entry = testdevs; entry; entry = entry->next) {
                int     status;