[U-Boot] [PATCH v4 06/15] usb: Correct use of debug()
Simon Glass
sjg at chromium.org
Mon Dec 4 20:48:22 UTC 2017
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 at chromium.org>
---
Changes in v4:
- Add new patch to correct use of debug() in usb_hub.c
Changes in v3: None
Changes in v2: None
common/usb_hub.c | 4 +---
1 file changed, 1 insertion(+), 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),
--
2.15.0.531.g2ccb3012c9-goog
More information about the U-Boot
mailing list