Commit 2866914c authored by Cristina Moraru's avatar Cristina Moraru Committed by Greg Kroah-Hartman

staging:emxx_udc: Fixed comparison style warnings

Fixed 'Comparisons should place the constant on the right side of the
test' Warnings
Signed-off-by: default avatarCristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b3ce2076
...@@ -589,7 +589,7 @@ static int EP0_out_OverBytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 length) ...@@ -589,7 +589,7 @@ static int EP0_out_OverBytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 length)
union usb_reg_access Temp32; union usb_reg_access Temp32;
union usb_reg_access *pBuf32 = (union usb_reg_access *)pBuf; union usb_reg_access *pBuf32 = (union usb_reg_access *)pBuf;
if ((0 < length) && (length < sizeof(u32))) { if ((length > 0) && (length < sizeof(u32))) {
Temp32.dw = _nbu2ss_readl(&udc->p_regs->EP0_READ); Temp32.dw = _nbu2ss_readl(&udc->p_regs->EP0_READ);
for (i = 0 ; i < length ; i++) for (i = 0 ; i < length ; i++)
pBuf32->byte.DATA[i] = Temp32.byte.DATA[i]; pBuf32->byte.DATA[i] = Temp32.byte.DATA[i];
...@@ -635,7 +635,7 @@ static int EP0_in_OverBytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 iRemainSize) ...@@ -635,7 +635,7 @@ static int EP0_in_OverBytes(struct nbu2ss_udc *udc, u8 *pBuf, u32 iRemainSize)
union usb_reg_access Temp32; union usb_reg_access Temp32;
union usb_reg_access *pBuf32 = (union usb_reg_access *)pBuf; union usb_reg_access *pBuf32 = (union usb_reg_access *)pBuf;
if ((0 < iRemainSize) && (iRemainSize < sizeof(u32))) { if ((iRemainSize > 0) && (iRemainSize < sizeof(u32))) {
for (i = 0 ; i < iRemainSize ; i++) for (i = 0 ; i < iRemainSize ; i++)
Temp32.byte.DATA[i] = pBuf32->byte.DATA[i]; Temp32.byte.DATA[i] = pBuf32->byte.DATA[i];
_nbu2ss_ep_in_end(udc, 0, Temp32.dw, iRemainSize); _nbu2ss_ep_in_end(udc, 0, Temp32.dw, iRemainSize);
...@@ -770,7 +770,7 @@ static int _nbu2ss_ep0_out_transfer( ...@@ -770,7 +770,7 @@ static int _nbu2ss_ep0_out_transfer(
req->req.actual += result; req->req.actual += result;
iRecvLength -= result; iRecvLength -= result;
if ((0 < iRecvLength) && (iRecvLength < sizeof(u32))) { if ((iRecvLength > 0) && (iRecvLength < sizeof(u32))) {
pBuffer += result; pBuffer += result;
iRemainSize -= result; iRemainSize -= result;
...@@ -849,11 +849,11 @@ static int _nbu2ss_out_dma( ...@@ -849,11 +849,11 @@ static int _nbu2ss_out_dma(
dmacnt = (length / mpkt); dmacnt = (length / mpkt);
lmpkt = (length % mpkt) & ~(u32)0x03; lmpkt = (length % mpkt) & ~(u32)0x03;
if (DMA_MAX_COUNT < dmacnt) { if (dmacnt > DMA_MAX_COUNT) {
dmacnt = DMA_MAX_COUNT; dmacnt = DMA_MAX_COUNT;
lmpkt = 0; lmpkt = 0;
} else if (0 != lmpkt) { } else if (lmpkt != 0) {
if (0 == dmacnt) if (dmacnt == 0)
burst = 0; /* Burst OFF */ burst = 0; /* Burst OFF */
dmacnt++; dmacnt++;
} }
...@@ -864,7 +864,7 @@ static int _nbu2ss_out_dma( ...@@ -864,7 +864,7 @@ static int _nbu2ss_out_dma(
data = ((dmacnt & 0xff) << 16) | DCR1_EPn_DIR0 | DCR1_EPn_REQEN; data = ((dmacnt & 0xff) << 16) | DCR1_EPn_DIR0 | DCR1_EPn_REQEN;
_nbu2ss_writel(&preg->EP_DCR[num].EP_DCR1, data); _nbu2ss_writel(&preg->EP_DCR[num].EP_DCR1, data);
if (0 == burst) { if (burst == 0) {
_nbu2ss_writel(&preg->EP_REGS[num].EP_LEN_DCNT, 0); _nbu2ss_writel(&preg->EP_REGS[num].EP_LEN_DCNT, 0);
_nbu2ss_bitclr(&preg->EP_REGS[num].EP_DMA_CTRL, EPn_BURST_SET); _nbu2ss_bitclr(&preg->EP_REGS[num].EP_DMA_CTRL, EPn_BURST_SET);
} else { } else {
...@@ -1438,7 +1438,7 @@ static int _nbu2ss_set_feature_device( ...@@ -1438,7 +1438,7 @@ static int _nbu2ss_set_feature_device(
switch (selector) { switch (selector) {
case USB_DEVICE_REMOTE_WAKEUP: case USB_DEVICE_REMOTE_WAKEUP:
if (0x0000 == wIndex) { if (wIndex == 0x0000) {
udc->remote_wakeup = U2F_ENABLE; udc->remote_wakeup = U2F_ENABLE;
result = 0; result = 0;
} }
...@@ -1495,8 +1495,8 @@ static inline int _nbu2ss_req_feature(struct nbu2ss_udc *udc, bool bset) ...@@ -1495,8 +1495,8 @@ static inline int _nbu2ss_req_feature(struct nbu2ss_udc *udc, bool bset)
u8 ep_adrs; u8 ep_adrs;
int result = -EOPNOTSUPP; int result = -EOPNOTSUPP;
if ((0x0000 != udc->ctrl.wLength) || if ((udc->ctrl.wLength != 0x0000) ||
(USB_DIR_OUT != direction)) { (direction != USB_DIR_OUT)) {
return -EINVAL; return -EINVAL;
} }
...@@ -1509,7 +1509,7 @@ static inline int _nbu2ss_req_feature(struct nbu2ss_udc *udc, bool bset) ...@@ -1509,7 +1509,7 @@ static inline int _nbu2ss_req_feature(struct nbu2ss_udc *udc, bool bset)
case USB_RECIP_ENDPOINT: case USB_RECIP_ENDPOINT:
if (0x0000 == (wIndex & 0xFF70)) { if (0x0000 == (wIndex & 0xFF70)) {
if (USB_ENDPOINT_HALT == selector) { if (selector == USB_ENDPOINT_HALT) {
ep_adrs = wIndex & 0xFF; ep_adrs = wIndex & 0xFF;
if (bset == FALSE) { if (bset == FALSE) {
_nbu2ss_endpoint_toggle_reset( _nbu2ss_endpoint_toggle_reset(
...@@ -1588,8 +1588,8 @@ static int std_req_get_status(struct nbu2ss_udc *udc) ...@@ -1588,8 +1588,8 @@ static int std_req_get_status(struct nbu2ss_udc *udc)
u8 ep_adrs; u8 ep_adrs;
int result = -EINVAL; int result = -EINVAL;
if ((0x0000 != udc->ctrl.wValue) if ((udc->ctrl.wValue != 0x0000)
|| (USB_DIR_IN != direction)) { || (direction != USB_DIR_IN)) {
return result; return result;
} }
...@@ -1653,9 +1653,9 @@ static int std_req_set_address(struct nbu2ss_udc *udc) ...@@ -1653,9 +1653,9 @@ static int std_req_set_address(struct nbu2ss_udc *udc)
int result = 0; int result = 0;
u32 wValue = udc->ctrl.wValue; u32 wValue = udc->ctrl.wValue;
if ((0x00 != udc->ctrl.bRequestType) || if ((udc->ctrl.bRequestType != 0x00) ||
(0x0000 != udc->ctrl.wIndex) || (udc->ctrl.wIndex != 0x0000) ||
(0x0000 != udc->ctrl.wLength)) { (udc->ctrl.wLength != 0x0000)) {
return -EINVAL; return -EINVAL;
} }
...@@ -1675,9 +1675,9 @@ static int std_req_set_configuration(struct nbu2ss_udc *udc) ...@@ -1675,9 +1675,9 @@ static int std_req_set_configuration(struct nbu2ss_udc *udc)
{ {
u32 ConfigValue = (u32)(udc->ctrl.wValue & 0x00ff); u32 ConfigValue = (u32)(udc->ctrl.wValue & 0x00ff);
if ((0x0000 != udc->ctrl.wIndex) || if ((udc->ctrl.wIndex != 0x0000) ||
(0x0000 != udc->ctrl.wLength) || (udc->ctrl.wLength != 0x0000) ||
(0x00 != udc->ctrl.bRequestType)) { (udc->ctrl.bRequestType != 0x00)) {
return -EINVAL; return -EINVAL;
} }
......
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