summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-12-04 13:48:22 -0700
committerTom Rini <trini@konsulko.com>2017-12-07 15:17:00 -0500
commit0ad0458c76107b29325b8c38804e0407bed42a79 (patch)
tree14e947ae0b0104f05663841916e19f72a546dde0
parent95b41b80d77b8418dac3393784b2a9cbb7abef64 (diff)
usb: Correct use of debug()
With clang this gives a warning because hubsts appears to be used before it is set, even if ultimately it is not used. Simplify the code to avoid this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--common/usb_hub.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/common/usb_hub.c b/common/usb_hub.c
index 024dadb277..b46dfa16cc 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -625,7 +625,7 @@ static int usb_hub_configure(struct usb_device *dev)
short hubCharacteristics;
struct usb_hub_descriptor *descriptor;
struct usb_hub_device *hub;
- __maybe_unused struct usb_hub_status *hubsts;
+ struct usb_hub_status *hubsts;
int ret;
hub = usb_get_hub_device(dev);
@@ -779,9 +779,7 @@ static int usb_hub_configure(struct usb_device *dev)
return ret;
}
-#ifdef DEBUG
hubsts = (struct usb_hub_status *)buffer;
-#endif
debug("get_hub_status returned status %X, change %X\n",
le16_to_cpu(hubsts->wHubStatus),