From f203f99dd5310f2df9d8d5a7e6a5b20dd2268549 Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Sun, 21 Oct 2018 08:17:49 +0900 Subject: [PATCH] xhci: Fix -Wtautological-pointer-compare Modify if condition, since: 1) Comparison of array 'current->buffer_log' equal to a null pointer is always false. Pointed out by clang. 2) XHCI::CreateDescriptor() sets buffer_log[0] to NULL, when bufferSize <= 0. Change-Id: I9a632dcf9c41435653b0556ed981d78bab846038 Reviewed-on: https://review.haiku-os.org/638 Reviewed-by: waddlesplash --- src/add-ons/kernel/busses/usb/xhci.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/busses/usb/xhci.cpp b/src/add-ons/kernel/busses/usb/xhci.cpp index ea81660619..c1f08bff12 100644 --- a/src/add-ons/kernel/busses/usb/xhci.cpp +++ b/src/add-ons/kernel/busses/usb/xhci.cpp @@ -1005,7 +1005,7 @@ XHCI::WriteDescriptorChain(xhci_td *descriptor, iovec *vector, size_t bufferOffset = 0; while (current != NULL) { - if (current->buffer_log == NULL) + if (current->buffer_log[0] == NULL) break; while (true) { @@ -1060,7 +1060,7 @@ XHCI::ReadDescriptorChain(xhci_td *descriptor, iovec *vector, size_t bufferOffset = 0; while (current != NULL) { - if (current->buffer_log == NULL) + if (current->buffer_log[0] == NULL) break; while (true) {