usb: dwc3: ep0: switch over to IS_ALIGNED
authorFelipe Balbi <balbi@ti.com>
Fri, 4 May 2012 10:08:22 +0000 (13:08 +0300)
committerFelipe Balbi <balbi@ti.com>
Sun, 3 Jun 2012 20:08:19 +0000 (23:08 +0300)
IS_ALIGNED provides a much faster operation for
checking proper size alignment then a modulo
operation. Let's use it.

Reported-by: Pratyush Anand <pratyush.anand@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/ep0.c

index 15ec36eb461b9e021bf7eb28946751c98ceb1775..477127aecb98c7654e0873c4b33dbf956c0cc330 100644 (file)
@@ -799,7 +799,7 @@ static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
                ret = dwc3_ep0_start_trans(dwc, dep->number,
                                dwc->ctrl_req_addr, 0,
                                DWC3_TRBCTL_CONTROL_DATA);
-       } else if ((req->request.length % dep->endpoint.maxpacket)
+       } else if (!IS_ALIGNED(req->request.length, dep->endpoint.maxpacket)
                        && (dep->number == 0)) {
                u32             transfer_size;