* [PATCH] testusb: Fix warning comparing pointer to 0
@ 2022-03-24 2:16 Haowen Bai
0 siblings, 0 replies; only message in thread
From: Haowen Bai @ 2022-03-24 2:16 UTC (permalink / raw)
To: gregkh, faizel.kb; +Cc: linux-kernel, Haowen Bai
Avoid pointer type value compared with 0 to make code clear.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
tools/usb/testusb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/usb/testusb.c b/tools/usb/testusb.c
index 69c3ead..474bae8 100644
--- a/tools/usb/testusb.c
+++ b/tools/usb/testusb.c
@@ -482,7 +482,7 @@ int main (int argc, char **argv)
}
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;
--
2.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-24 2:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-24 2:16 [PATCH] testusb: Fix warning comparing pointer to 0 Haowen Bai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).