staging: rtl8188eu: rewrite the right hand side of an assignment
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Thu, 26 Feb 2015 09:41:51 +0000 (11:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Feb 2015 23:24:15 +0000 (15:24 -0800)
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: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/usb_halinit.c

index 14650e91c78a55f4765e520a9c3c58b9275b4a4c..122e9b37aa79a297b541f294d4cebdca8dd65be5 100644 (file)
@@ -1352,7 +1352,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
 
                        /*  Set RTS initial rate */
                        while (BrateCfg > 0x1) {
-                               BrateCfg = (BrateCfg >> 1);
+                               BrateCfg >>= 1;
                                RateIndex++;
                        }
                        /*  Ziv - Check */