aboutsummaryrefslogtreecommitdiff
path: root/hw/usb
diff options
context:
space:
mode:
authorLiam Merwick <liam.merwick@oracle.com>2019-02-06 13:36:56 +0000
committerGerd Hoffmann <kraxel@redhat.com>2019-02-20 09:41:23 +0100
commit7011baece29d0e197c54c4e57326ba88e67a4949 (patch)
tree6a706ed412d6546a25077931d14daae02c75eedb /hw/usb
parent4fc12aa1fcc212e47a695b4cd34e75f3dab7d7d7 (diff)
usb: remove unnecessary NULL device check from usb_ep_get()
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> Message-id: 1549460216-25808-10-git-send-email-liam.merwick@oracle.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb')
-rw-r--r--hw/usb/core.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/usb/core.c b/hw/usb/core.c
index bfb7ae67bb..8fbd9c7d57 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;
}