staging: remove unneeded parentheses around the right hand side of an assignment
authorJiayi Ye <yejiayily@gmail.com>
Sat, 25 Oct 2014 02:58:28 +0000 (10:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Oct 2014 02:33:06 +0000 (10:33 +0800)
In assignments such as value = (FLASH_CMD_STATUS_REG_READ << 24);, parentheses
are not needed. The Coccinelle semantic patch was used to find cases.

@r@
identifier x;
expression e1, e2;
@@

- x = (e1 << e2);
+ x = e1 << e2;

Signed-off-by: Jiayi Ye <yejiayily@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
drivers/staging/lustre/lustre/libcfs/debug.c
drivers/staging/lustre/lustre/llite/rw.c
drivers/staging/media/davinci_vpfe/dm365_resizer.c
drivers/staging/media/omap24xx/omap24xxcam.c
drivers/staging/ozwpan/ozhcd.c
drivers/staging/rtl8188eu/hal/usb_halinit.c
drivers/staging/rtl8723au/hal/hal_com.c
drivers/staging/vt6655/dpc.c
drivers/staging/xgifb/vb_setmode.c

index 8f5cdd584f85b5ed888dbb8550f91ccc05fd8385..045f2beb41d297c448329aef7447ac1698affb1a 100644 (file)
@@ -2411,7 +2411,7 @@ kiblnd_hdev_setup_mrs(kib_hca_dev_t *hdev)
                goto out;
        }
 
-       mr_size = (1ULL << hdev->ibh_mr_shift);
+       mr_size = 1ULL << hdev->ibh_mr_shift;
        mm_size = (unsigned long)high_memory - PAGE_OFFSET;
 
        hdev->ibh_nmrs = (int)((mm_size + mr_size - 1) >> hdev->ibh_mr_shift);
index 6054eee848d3d08dfc165f58b1dfafbb323e50dd..3822e0f3faf07ef3108e0195fe257ddab43399ff 100644 (file)
@@ -265,7 +265,7 @@ static void ldlm_pool_recalc_slv(struct ldlm_pool *pl)
         * SLV. And the opposite, the more grant plan is over-consumed
         * (load time) the faster drops SLV.
         */
-       slv_factor = (grant_usage << LDLM_POOL_SLV_SHIFT);
+       slv_factor = grant_usage << LDLM_POOL_SLV_SHIFT;
        do_div(slv_factor, limit);
        slv = slv * slv_factor;
        slv = dru(slv, LDLM_POOL_SLV_SHIFT, round_up);
index ba43b3067fa3edcfaa14869add634c307b7e9a78..2c15a9e7332fa8b67cbef3927379e601967ad6f0 100644 (file)
@@ -412,7 +412,7 @@ int libcfs_debug_init(unsigned long bufsize)
                max = TCD_MAX_PAGES;
        } else {
                max = (max / num_possible_cpus());
-               max = (max << (20 - PAGE_CACHE_SHIFT));
+               max = max << (20 - PAGE_CACHE_SHIFT);
        }
        rc = cfs_tracefile_init(max);
 
index 1f53b986338552ea7fbe7edc97fbb9722ffd65c0..613d772357ac4f86b5f86c2b68649a5140c591fe 100644 (file)
@@ -145,7 +145,7 @@ static struct ll_cl_context *ll_cl_init(struct file *file,
                 */
                io->ci_lockreq = CILR_NEVER;
 
-               pos = (vmpage->index << PAGE_CACHE_SHIFT);
+               pos = vmpage->index << PAGE_CACHE_SHIFT;
 
                /* Create a temp IO to serve write. */
                result = cl_io_rw_init(env, io, CIT_WRITE, pos, PAGE_CACHE_SIZE);
index 8828d6c2aab17df8f423d6d88bc17920b4758158..415502651033da8824db84212ad7770e3f26f90b 100644 (file)
@@ -633,7 +633,7 @@ resizer_calculate_normal_f_div_param(struct device *dev, int input_width,
        if (!(val % 2)) {
                h1 = val;
        } else {
-               val = (input_width << 7);
+               val = input_width << 7;
                val -= rsz >> 1;
                val /= rsz << 1;
                val <<= 1;
index 5ca2bf5353fe9ee2ad66e798dce1de91b5e88768..36d81e0e114c1b520f45df6c27cbbb8e9cb1b933 100644 (file)
@@ -326,7 +326,7 @@ static int omap24xxcam_vbq_alloc_mmap_buffer(struct videobuf_buffer *vb)
                dma->sglen++;
                i++;
 
-               alloc_size = (PAGE_SIZE << order);
+               alloc_size = PAGE_SIZE << order;
 
                /* clear pages before giving them to user space */
                memset(page_address(page), 0, alloc_size);
index e8804522860731a01492e89c598596ff1162b3f7..8a52feb6e72e61d9795991b257b4d106a5b8e421 100644 (file)
@@ -2032,11 +2032,11 @@ static int oz_clear_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex)
                break;
        case USB_PORT_FEAT_C_CONNECTION:
                oz_dbg(HUB, "USB_PORT_FEAT_C_CONNECTION\n");
-               clear_bits = (USB_PORT_STAT_C_CONNECTION << 16);
+               clear_bits = USB_PORT_STAT_C_CONNECTION << 16;
                break;
        case USB_PORT_FEAT_C_ENABLE:
                oz_dbg(HUB, "USB_PORT_FEAT_C_ENABLE\n");
-               clear_bits = (USB_PORT_STAT_C_ENABLE << 16);
+               clear_bits = USB_PORT_STAT_C_ENABLE << 16;
                break;
        case USB_PORT_FEAT_C_SUSPEND:
                oz_dbg(HUB, "USB_PORT_FEAT_C_SUSPEND\n");
@@ -2046,7 +2046,7 @@ static int oz_clear_port_feature(struct usb_hcd *hcd, u16 wvalue, u16 windex)
                break;
        case USB_PORT_FEAT_C_RESET:
                oz_dbg(HUB, "USB_PORT_FEAT_C_RESET\n");
-               clear_bits = (USB_PORT_FEAT_C_RESET << 16);
+               clear_bits = USB_PORT_FEAT_C_RESET << 16;
                break;
        case USB_PORT_FEAT_TEST:
                oz_dbg(HUB, "USB_PORT_FEAT_TEST\n");
index caf2ca3a47e7c9ce906a460a12a8bca7435fc232..ac6abac58bfebeabef4695b904747589fff7836a 100644 (file)
@@ -1673,7 +1673,7 @@ static void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
                        pRegToSet = RegToSet_Normal; /*  0xb972a841; */
                        FactorToSet = *((u8 *)val);
                        if (FactorToSet <= 3) {
-                               FactorToSet = (1<<(FactorToSet + 2));
+                               FactorToSet = 1 << (FactorToSet + 2);
                                if (FactorToSet > 0xf)
                                        FactorToSet = 0xf;
 
index f906317579bc30d5dc0c4ab938c97c153b92d5aa..bf4cae20bd1273cb6673818f47af586dea685774 100644 (file)
@@ -463,7 +463,7 @@ void rtl8723a_set_ampdu_factor(struct rtw_adapter *padapter, u8 FactorToSet)
                MaxAggNum = 0xF;
 
        if (FactorToSet <= 3) {
-               FactorToSet = (1 << (FactorToSet + 2));
+               FactorToSet = 1 << (FactorToSet + 2);
                if (FactorToSet > MaxAggNum)
                        FactorToSet = MaxAggNum;
 
index 344e12f1184effaa0bbf6f69bcbe0dd6f2a30deb..eecf6f559e29118f6e0e109d2740c8fcc78599b5 100644 (file)
@@ -358,7 +358,7 @@ device_receive_frame(
                if ((*pbyRsr & RSR_CRCOK) != 0)
                        pDevice->byBasicMap |= 0x01;
 
-               dwDuration = (FrameSize << 4);
+               dwDuration = FrameSize << 4;
                dwDuration /= acbyRxRate[*pbyRxRate%MAX_RATE];
                if (*pbyRxRate <= RATE_11M) {
                        if (*pbyRxSts & 0x01) {
index d5f49d2a8db3185bde614adab07122bcd03f99c4..1f6f699e238c35eb818611d6d048a7ebebefa6e6 100644 (file)
@@ -4135,7 +4135,7 @@ static void XGI_SetGroup4(unsigned short ModeIdIndex,
                tempax -= 1;
 
                temp = (tempax & 0xFF00) >> 8;
-               temp = ((temp & 0x0003) << 4);
+               temp = (temp & 0x0003) << 4;
                xgifb_reg_set(pVBInfo->Part4Port, 0x1E, temp);
                temp = (tempax & 0x00FF);
                xgifb_reg_set(pVBInfo->Part4Port, 0x1D, temp);