mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-22 04:23:39 +00:00
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:
parent
5105d48231
commit
348dbdf95f
1 changed files with 13 additions and 16 deletions
|
@ -62,7 +62,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;
|
||||||
|
|
||||||
|
@ -91,10 +90,8 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
|
||||||
|
|
||||||
for (i = 0; i < pdvobjpriv->nr_endpoint; i++) {
|
for (i = 0; i < pdvobjpriv->nr_endpoint; i++) {
|
||||||
int ep_num;
|
int ep_num;
|
||||||
phost_endp = phost_iface->endpoint + i;
|
|
||||||
|
|
||||||
if (phost_endp) {
|
pendp_desc = &phost_iface->endpoint[i].desc;
|
||||||
pendp_desc = &phost_endp->desc;
|
|
||||||
ep_num = usb_endpoint_num(pendp_desc);
|
ep_num = usb_endpoint_num(pendp_desc);
|
||||||
|
|
||||||
if (usb_endpoint_is_bulk_in(pendp_desc)) {
|
if (usb_endpoint_is_bulk_in(pendp_desc)) {
|
||||||
|
@ -104,12 +101,12 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
|
||||||
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
|
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
|
||||||
pdvobjpriv->RtNumInPipes++;
|
pdvobjpriv->RtNumInPipes++;
|
||||||
} else if (usb_endpoint_is_bulk_out(pendp_desc)) {
|
} else if (usb_endpoint_is_bulk_out(pendp_desc)) {
|
||||||
pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] = ep_num;
|
pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] =
|
||||||
|
ep_num;
|
||||||
pdvobjpriv->RtNumOutPipes++;
|
pdvobjpriv->RtNumOutPipes++;
|
||||||
}
|
}
|
||||||
pdvobjpriv->ep_num[i] = ep_num;
|
pdvobjpriv->ep_num[i] = ep_num;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (pusbd->speed == USB_SPEED_HIGH)
|
if (pusbd->speed == USB_SPEED_HIGH)
|
||||||
pdvobjpriv->ishighspeed = true;
|
pdvobjpriv->ishighspeed = true;
|
||||||
|
|
Loading…
Reference in a new issue