diff mbox series

[v2,9/9] usb: remove unnecessary NULL device check from usb_ep_get()

Message ID 1549460216-25808-10-git-send-email-liam.merwick@oracle.com (mailing list archive)
State New, archived
Headers show
Series Dealing with Null devices in usb_ep_get() | expand

Commit Message

Liam Merwick Feb. 6, 2019, 1:36 p.m. UTC
No caller of usb_ep_get() calls it with a NULL device (previous commits
have addressed the few remaining cases which didn't explicitly check).
Replace check for 'dev == NULL' with an assert instead.

Signed-off-by: Liam Merwick <liam.merwick@oracle.com>
---
 hw/usb/core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/hw/usb/core.c b/hw/usb/core.c
index bfb7ae67bbf0..8fbd9c7d573b 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -717,9 +717,7 @@  struct USBEndpoint *usb_ep_get(USBDevice *dev, int pid, int ep)
 {
     struct USBEndpoint *eps;
 
-    if (dev == NULL) {
-        return NULL;
-    }
+    assert(dev != NULL);
     if (ep == 0) {
         return &dev->ep_ctl;
     }