Commit 410c944e authored by Aya Mahfouz's avatar Aya Mahfouz Committed by Greg Kroah-Hartman

staging: emxx_udc: rewrite the right hand side of an assignment

This patch rewrites the right hand side of an assignment for
expressions of the form:
a = (a <op> b);
to be:
a <op>= b;
where <op> = << | >>.

This issue was detected and resolved using the following
coccinelle script:

@@
identifier i;
expression e;
@@

-i = (i >> e);
+i >>= e;

@@
identifier i;
expression e;
@@

-i = (i << e);
+i <<= e;
Signed-off-by: default avatarAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1525ecfc
...@@ -1454,7 +1454,7 @@ static int _nbu2ss_set_feature_device( ...@@ -1454,7 +1454,7 @@ static int _nbu2ss_set_feature_device(
break; break;
case USB_DEVICE_TEST_MODE: case USB_DEVICE_TEST_MODE:
wIndex = wIndex >> 8; wIndex >>= 8;
if (wIndex <= MAX_TEST_MODE_NUM) if (wIndex <= MAX_TEST_MODE_NUM)
result = 0; result = 0;
break; break;
...@@ -1671,7 +1671,7 @@ static int std_req_set_address(struct nbu2ss_udc *udc) ...@@ -1671,7 +1671,7 @@ static int std_req_set_address(struct nbu2ss_udc *udc)
if (wValue != (wValue & 0x007F)) if (wValue != (wValue & 0x007F))
return -EINVAL; return -EINVAL;
wValue = wValue << USB_ADRS_SHIFT; wValue <<= USB_ADRS_SHIFT;
_nbu2ss_writel(&udc->p_regs->USB_ADDRESS, wValue); _nbu2ss_writel(&udc->p_regs->USB_ADDRESS, wValue);
_nbu2ss_create_ep0_packet(udc, udc->ep0_buf, 0); _nbu2ss_create_ep0_packet(udc, udc->ep0_buf, 0);
......
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