Commit 86763723 authored by Christos Gkekas's avatar Christos Gkekas Committed by Felipe Balbi

usb: dwc3: ep0: Clean up unused variables

Many variables in ep0 are set but never used, so should be removed.
Signed-off-by: default avatarChristos Gkekas <chris.gekas@gmail.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent d8fae8b9
...@@ -487,14 +487,10 @@ static int dwc3_ep0_handle_device(struct dwc3 *dwc, ...@@ -487,14 +487,10 @@ static int dwc3_ep0_handle_device(struct dwc3 *dwc,
static int dwc3_ep0_handle_intf(struct dwc3 *dwc, static int dwc3_ep0_handle_intf(struct dwc3 *dwc,
struct usb_ctrlrequest *ctrl, int set) struct usb_ctrlrequest *ctrl, int set)
{ {
enum usb_device_state state;
u32 wValue; u32 wValue;
u32 wIndex;
int ret = 0; int ret = 0;
wValue = le16_to_cpu(ctrl->wValue); wValue = le16_to_cpu(ctrl->wValue);
wIndex = le16_to_cpu(ctrl->wIndex);
state = dwc->gadget.state;
switch (wValue) { switch (wValue) {
case USB_INTRF_FUNC_SUSPEND: case USB_INTRF_FUNC_SUSPEND:
...@@ -517,14 +513,10 @@ static int dwc3_ep0_handle_endpoint(struct dwc3 *dwc, ...@@ -517,14 +513,10 @@ static int dwc3_ep0_handle_endpoint(struct dwc3 *dwc,
struct usb_ctrlrequest *ctrl, int set) struct usb_ctrlrequest *ctrl, int set)
{ {
struct dwc3_ep *dep; struct dwc3_ep *dep;
enum usb_device_state state;
u32 wValue; u32 wValue;
u32 wIndex;
int ret; int ret;
wValue = le16_to_cpu(ctrl->wValue); wValue = le16_to_cpu(ctrl->wValue);
wIndex = le16_to_cpu(ctrl->wIndex);
state = dwc->gadget.state;
switch (wValue) { switch (wValue) {
case USB_ENDPOINT_HALT: case USB_ENDPOINT_HALT:
...@@ -551,10 +543,8 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc, ...@@ -551,10 +543,8 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
{ {
u32 recip; u32 recip;
int ret; int ret;
enum usb_device_state state;
recip = ctrl->bRequestType & USB_RECIP_MASK; recip = ctrl->bRequestType & USB_RECIP_MASK;
state = dwc->gadget.state;
switch (recip) { switch (recip) {
case USB_RECIP_DEVICE: case USB_RECIP_DEVICE:
...@@ -712,12 +702,10 @@ static int dwc3_ep0_set_sel(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl) ...@@ -712,12 +702,10 @@ static int dwc3_ep0_set_sel(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
struct dwc3_ep *dep; struct dwc3_ep *dep;
enum usb_device_state state = dwc->gadget.state; enum usb_device_state state = dwc->gadget.state;
u16 wLength; u16 wLength;
u16 wValue;
if (state == USB_STATE_DEFAULT) if (state == USB_STATE_DEFAULT)
return -EINVAL; return -EINVAL;
wValue = le16_to_cpu(ctrl->wValue);
wLength = le16_to_cpu(ctrl->wLength); wLength = le16_to_cpu(ctrl->wLength);
if (wLength != 6) { if (wLength != 6) {
...@@ -842,9 +830,6 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc, ...@@ -842,9 +830,6 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
struct usb_request *ur; struct usb_request *ur;
struct dwc3_trb *trb; struct dwc3_trb *trb;
struct dwc3_ep *ep0; struct dwc3_ep *ep0;
unsigned maxp;
unsigned remaining_ur_length;
void *buf;
u32 transferred = 0; u32 transferred = 0;
u32 status; u32 status;
u32 length; u32 length;
...@@ -871,11 +856,8 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc, ...@@ -871,11 +856,8 @@ static void dwc3_ep0_complete_data(struct dwc3 *dwc,
} }
ur = &r->request; ur = &r->request;
buf = ur->buf;
remaining_ur_length = ur->length;
length = trb->size & DWC3_TRB_SIZE_MASK; length = trb->size & DWC3_TRB_SIZE_MASK;
maxp = ep0->endpoint.maxpacket;
transferred = ur->length - length; transferred = ur->length - length;
ur->actual += transferred; ur->actual += transferred;
...@@ -1001,7 +983,6 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc, ...@@ -1001,7 +983,6 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
} else if (IS_ALIGNED(req->request.length, dep->endpoint.maxpacket) && } else if (IS_ALIGNED(req->request.length, dep->endpoint.maxpacket) &&
req->request.length && req->request.zero) { req->request.length && req->request.zero) {
u32 maxpacket; u32 maxpacket;
u32 rem;
ret = usb_gadget_map_request_by_dev(dwc->sysdev, ret = usb_gadget_map_request_by_dev(dwc->sysdev,
&req->request, dep->number); &req->request, dep->number);
...@@ -1009,7 +990,6 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc, ...@@ -1009,7 +990,6 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
return; return;
maxpacket = dep->endpoint.maxpacket; maxpacket = dep->endpoint.maxpacket;
rem = req->request.length % maxpacket;
/* prepare normal TRB */ /* prepare normal TRB */
dwc3_ep0_prepare_one_trb(dep, req->request.dma, dwc3_ep0_prepare_one_trb(dep, req->request.dma,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment