rtl8188eu: usb_dvobj_init(): A NULL pointer check for usb_host_endpoints makes no sense

Simplify the code.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2014-12-01 16:13:11 -06:00
parent 849d585656
commit 86fdc52e9a

View file

@ -161,7 +161,6 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
struct usb_config_descriptor *pconf_desc; struct usb_config_descriptor *pconf_desc;
struct usb_host_interface *phost_iface; struct usb_host_interface *phost_iface;
struct usb_interface_descriptor *piface_desc; struct usb_interface_descriptor *piface_desc;
struct usb_host_endpoint *phost_endp;
struct usb_endpoint_descriptor *pendp_desc; struct usb_endpoint_descriptor *pendp_desc;
struct usb_device *pusbd; struct usb_device *pusbd;
@ -190,45 +189,25 @@ _func_enter_;
pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints; pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints;
for (i = 0; i < pdvobjpriv->nr_endpoint; i++) { for (i = 0; i < pdvobjpriv->nr_endpoint; i++) {
phost_endp = phost_iface->endpoint + i; int ep_num;
if (phost_endp) { pendp_desc = &phost_iface->endpoint[i].desc;
pendp_desc = &phost_endp->desc;
DBG_88E("\nusb_endpoint_descriptor(%d):\n", i); ep_num = usb_endpoint_num(pendp_desc);
DBG_88E("bLength=%x\n", pendp_desc->bLength);
DBG_88E("bDescriptorType=%x\n",
pendp_desc->bDescriptorType);
DBG_88E("bEndpointAddress=%x\n",
pendp_desc->bEndpointAddress);
DBG_88E("wMaxPacketSize=%d\n",
le16_to_cpu(pendp_desc->wMaxPacketSize));
DBG_88E("bInterval=%x\n", pendp_desc->bInterval);
if (RT_usb_endpoint_is_bulk_in(pendp_desc)) { if (usb_endpoint_is_bulk_in(pendp_desc)) {
DBG_88E("RT_usb_endpoint_is_bulk_in = %x\n", pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
RT_usb_endpoint_num(pendp_desc)); pdvobjpriv->RtNumInPipes++;
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = RT_usb_endpoint_num(pendp_desc); } else if (usb_endpoint_is_int_in(pendp_desc)) {
pdvobjpriv->RtNumInPipes++; pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
} else if (usb_endpoint_is_int(pendp_desc)) { pdvobjpriv->RtNumInPipes++;
DBG_88E("usb_endpoint_is_int = %x, Interval = %x\n", } else if (usb_endpoint_is_bulk_out(pendp_desc)) {
RT_usb_endpoint_num(pendp_desc), pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] =
pendp_desc->bInterval); ep_num;
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = RT_usb_endpoint_num(pendp_desc); pdvobjpriv->RtNumOutPipes++;
pdvobjpriv->RtNumInPipes++;
} else if (RT_usb_endpoint_is_bulk_out(pendp_desc)) {
DBG_88E("RT_usb_endpoint_is_bulk_out = %x\n",
RT_usb_endpoint_num(pendp_desc));
pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] = RT_usb_endpoint_num(pendp_desc);
pdvobjpriv->RtNumOutPipes++;
}
pdvobjpriv->ep_num[i] = RT_usb_endpoint_num(pendp_desc);
} }
pdvobjpriv->ep_num[i] = ep_num;
} }
DBG_88E("nr_endpoint=%d, in_num=%d, out_num=%d\n\n",
pdvobjpriv->nr_endpoint, pdvobjpriv->RtNumInPipes,
pdvobjpriv->RtNumOutPipes);
if (pusbd->speed == USB_SPEED_HIGH) { if (pusbd->speed == USB_SPEED_HIGH) {
pdvobjpriv->ishighspeed = true; pdvobjpriv->ishighspeed = true;
DBG_88E("USB_SPEED_HIGH\n"); DBG_88E("USB_SPEED_HIGH\n");