All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/13] remove extra parentheses around right bit shift operations
@ 2015-03-04  5:28 Aya Mahfouz
  2015-03-04  5:28 ` [PATCH 01/13] staging: comedi: drivers: remove extra parentheses around right bit shift operation Aya Mahfouz
                   ` (12 more replies)
  0 siblings, 13 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:28 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operations using
coccinelle. The cases handled here are when resultant values are assigned to
variables or when a shift operation is employed on a function argument.


Aya Mahfouz (13):
  staging: comedi: drivers: remove extra parentheses around right bit shift
    operation
  staging: lustre: lclient: remove extra parentheses around right bit shift
    operation
  staging: lustre: llite: remove extra parentheses around right bit shift
    operation
  staging: media: bcm2048: remove extra parentheses around right bit shift
    operation
  staging: media: lirc: remove extra parentheses around right bit shift
    operation
  staging: rtl8188eu: remove extra parentheses around right bit shift
    operations
  staging: rtl8192e: remove extra parentheses around right bit shift operation
  staging: rtl8192u: remove extra parentheses around right bit shift operation
  staging: rtl8712: remove extra parentheses around right bit shift operation
  staging: rtl8723au: remove extra parentheses around right bit shift
    operations
  staging: slicoss: remove extra parentheses around right bit shift operations
  staging: speakup: remove extra parentheses around right bit shift operation
  staging: xgifb: remove extra parentheses around right bit shift
    operations

 drivers/staging/comedi/drivers/dt2801.c            |  2 +-
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c |  5 ++--
 drivers/staging/lustre/lustre/llite/vvp_dev.c      |  2 +-
 drivers/staging/media/bcm2048/radio-bcm2048.c      |  3 +--
 drivers/staging/media/lirc/lirc_serial.c           |  2 +-
 drivers/staging/rtl8188eu/core/rtw_efuse.c         |  2 +-
 drivers/staging/rtl8188eu/hal/odm.c                |  8 +++----
 drivers/staging/rtl8188eu/hal/odm_HWConfig.c       |  2 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c  |  3 ++-
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c     | 28 +++++++++++-----------
 drivers/staging/rtl8192u/r8192U_core.c             | 16 +++++++------
 drivers/staging/rtl8712/rtl8712_recv.c             |  4 ++--
 drivers/staging/rtl8712/rtl871x_mp.c               |  4 ++--
 drivers/staging/rtl8723au/hal/odm.c                |  6 ++---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c  |  6 ++---
 drivers/staging/slicoss/slicoss.c                  |  6 ++---
 drivers/staging/speakup/main.c                     |  2 +-
 drivers/staging/xgifb/XGI_main_26.c                |  6 ++---
 18 files changed, 55 insertions(+), 52 deletions(-)

-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 01/13] staging: comedi: drivers: remove extra parentheses around right bit shift operation
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
@ 2015-03-04  5:28 ` Aya Mahfouz
  2015-03-04  5:29 ` [PATCH 02/13] staging: lustre: lclient: " Aya Mahfouz
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:28 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operation.
The issue was detected and resolved using the following coccinelle
script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/comedi/drivers/dt2801.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/dt2801.c b/drivers/staging/comedi/drivers/dt2801.c
index b96e60f..7e565fc 100644
--- a/drivers/staging/comedi/drivers/dt2801.c
+++ b/drivers/staging/comedi/drivers/dt2801.c
@@ -280,7 +280,7 @@ static int dt2801_writedata2(struct comedi_device *dev, unsigned int data)
 	ret = dt2801_writedata(dev, data & 0xff);
 	if (ret < 0)
 		return ret;
-	ret = dt2801_writedata(dev, (data >> 8));
+	ret = dt2801_writedata(dev, data >> 8);
 	if (ret < 0)
 		return ret;
 
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 02/13] staging: lustre: lclient: remove extra parentheses around right bit shift operation
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
  2015-03-04  5:28 ` [PATCH 01/13] staging: comedi: drivers: remove extra parentheses around right bit shift operation Aya Mahfouz
@ 2015-03-04  5:29 ` Aya Mahfouz
  2015-03-04  5:30 ` [PATCH 03/13] staging: lustre: llite: " Aya Mahfouz
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:29 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operations.
The cases handled here are when the resultant value is assigned
to a variable. The issue was detected and resolved using the
following coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
index 23095bb..ab6cb41 100644
--- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
+++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
@@ -828,7 +828,8 @@ int ccc_prep_size(const struct lu_env *env, struct cl_object *obj,
 				 * --bug 17336 */
 				loff_t size = cl_isize_read(inode);
 				loff_t cur_index = start >> PAGE_CACHE_SHIFT;
-				loff_t size_index = ((size - 1) >> PAGE_CACHE_SHIFT);
+				loff_t size_index = (size - 1) >>
+						    PAGE_CACHE_SHIFT;
 
 				if ((size == 0 && cur_index != 0) ||
 				    size_index < cur_index)
@@ -1263,7 +1264,7 @@ __u32 cl_fid_build_gen(const struct lu_fid *fid)
 		return gen;
 	}
 
-	gen = (fid_flatten(fid) >> 32);
+	gen = fid_flatten(fid) >> 32;
 	return gen;
 }
 
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 03/13] staging: lustre: llite: remove extra parentheses around right bit shift operation
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
  2015-03-04  5:28 ` [PATCH 01/13] staging: comedi: drivers: remove extra parentheses around right bit shift operation Aya Mahfouz
  2015-03-04  5:29 ` [PATCH 02/13] staging: lustre: lclient: " Aya Mahfouz
@ 2015-03-04  5:30 ` Aya Mahfouz
  2015-03-04  5:30 ` [PATCH 04/13] staging: media: bcm2048: " Aya Mahfouz
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:30 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operation.
The case handled here is when the resultant value is assigned to
a variable. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e = 
-(e1
+e1
>>
-c);
+c;

@@ 
identifier i;
constant c;
type t;
expression e;
@@

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


@@ 
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/lustre/lustre/llite/vvp_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c
index 5a1078a..97d94fc 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_dev.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c
@@ -286,7 +286,7 @@ static void vvp_pgcache_id_unpack(loff_t pos, struct vvp_pgcache_id *id)
 
 	id->vpi_index  = pos & 0xffffffff;
 	id->vpi_depth  = (pos >> PGC_DEPTH_SHIFT) & 0xf;
-	id->vpi_bucket = ((unsigned long long)pos >> PGC_OBJ_SHIFT);
+	id->vpi_bucket = (unsigned long long)pos >> PGC_OBJ_SHIFT;
 }
 
 static loff_t vvp_pgcache_id_pack(struct vvp_pgcache_id *id)
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 04/13] staging: media: bcm2048: remove extra parentheses around right bit shift operation
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (2 preceding siblings ...)
  2015-03-04  5:30 ` [PATCH 03/13] staging: lustre: llite: " Aya Mahfouz
@ 2015-03-04  5:30 ` Aya Mahfouz
  2015-03-04  5:31 ` [PATCH 05/13] staging: media: lirc: " Aya Mahfouz
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:30 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operation.
The case handled here is when the resultant value is assigned to
a variable. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/media/bcm2048/radio-bcm2048.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 5382506..116251b 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -2245,8 +2245,7 @@ static ssize_t bcm2048_fops_read(struct file *file, char __user *buf,
 
 		tmpbuf[i] = bdev->rds_info.radio_text[bdev->rd_index+i+2];
 		tmpbuf[i+1] = bdev->rds_info.radio_text[bdev->rd_index+i+1];
-		tmpbuf[i+2] = ((bdev->rds_info.radio_text[bdev->rd_index+i]
-				& 0xf0) >> 4);
+		tmpbuf[i+2] = (bdev->rds_info.radio_text[bdev->rd_index + i] & 0xf0) >> 4;
 		if ((bdev->rds_info.radio_text[bdev->rd_index+i] &
 			BCM2048_RDS_CRC_MASK) == BCM2048_RDS_CRC_UNRECOVARABLE)
 			tmpbuf[i+2] |= 0x80;
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 05/13] staging: media: lirc: remove extra parentheses around right bit shift operation
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (3 preceding siblings ...)
  2015-03-04  5:30 ` [PATCH 04/13] staging: media: bcm2048: " Aya Mahfouz
@ 2015-03-04  5:31 ` Aya Mahfouz
  2015-03-04  5:31 ` [PATCH 06/13] staging: rtl8188eu: remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:31 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operation.
The case handled here is when the resultant value is assigned to
a variable. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/media/lirc/lirc_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/lirc/lirc_serial.c b/drivers/staging/media/lirc/lirc_serial.c
index 19628d0..9f55a83 100644
--- a/drivers/staging/media/lirc/lirc_serial.c
+++ b/drivers/staging/media/lirc/lirc_serial.c
@@ -344,7 +344,7 @@ static int init_timing_params(unsigned int new_duty_cycle,
 	/* How many clocks in a microsecond?, avoiding long long divide */
 	work = loops_per_sec;
 	work *= 4295;  /* 4295 = 2^32 / 1e6 */
-	conv_us_to_clocks = (work >> 32);
+	conv_us_to_clocks = work >> 32;
 
 	/*
 	 * Carrier period in clocks, approach good up to 32GHz clock,
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 06/13] staging: rtl8188eu: remove extra parentheses around right bit shift operations
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (4 preceding siblings ...)
  2015-03-04  5:31 ` [PATCH 05/13] staging: media: lirc: " Aya Mahfouz
@ 2015-03-04  5:31 ` Aya Mahfouz
  2015-03-04  5:32 ` [PATCH 07/13] staging: rtl8192e: remove extra parentheses around right bit shift operation Aya Mahfouz
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:31 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_efuse.c        | 2 +-
 drivers/staging/rtl8188eu/hal/odm.c               | 8 ++++----
 drivers/staging/rtl8188eu/hal/odm_HWConfig.c      | 2 +-
 drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c | 3 ++-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index 8816d11..defec6b 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -139,7 +139,7 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8  *pbuf)
 	while ((rtemp8 != 0xFF) && (eFuse_Addr < EFUSE_REAL_CONTENT_LEN_88E)) {
 		/*  Check PG header for section num. */
 		if ((rtemp8 & 0x1F) == 0x0F) {		/* extended header */
-			u1temp = ((rtemp8 & 0xE0) >> 5);
+			u1temp = (rtemp8 & 0xE0) >> 5;
 			rtemp8 = *(phymap+eFuse_Addr);
 			if ((rtemp8 & 0x0F) == 0x0F) {
 				eFuse_Addr++;
diff --git a/drivers/staging/rtl8188eu/hal/odm.c b/drivers/staging/rtl8188eu/hal/odm.c
index 06477e8..28b5e7b 100644
--- a/drivers/staging/rtl8188eu/hal/odm.c
+++ b/drivers/staging/rtl8188eu/hal/odm.c
@@ -741,13 +741,13 @@ void odm_FalseAlarmCounterStatistics(struct odm_dm_struct *pDM_Odm)
 
 	ret_value = phy_query_bb_reg(adapter, ODM_REG_OFDM_FA_TYPE1_11N, bMaskDWord);
 	FalseAlmCnt->Cnt_Fast_Fsync = (ret_value&0xffff);
-	FalseAlmCnt->Cnt_SB_Search_fail = ((ret_value&0xffff0000)>>16);
+	FalseAlmCnt->Cnt_SB_Search_fail = (ret_value & 0xffff0000)>>16;
 	ret_value = phy_query_bb_reg(adapter, ODM_REG_OFDM_FA_TYPE2_11N, bMaskDWord);
 	FalseAlmCnt->Cnt_OFDM_CCA = (ret_value&0xffff);
-	FalseAlmCnt->Cnt_Parity_Fail = ((ret_value&0xffff0000)>>16);
+	FalseAlmCnt->Cnt_Parity_Fail = (ret_value & 0xffff0000)>>16;
 	ret_value = phy_query_bb_reg(adapter, ODM_REG_OFDM_FA_TYPE3_11N, bMaskDWord);
 	FalseAlmCnt->Cnt_Rate_Illegal = (ret_value&0xffff);
-	FalseAlmCnt->Cnt_Crc8_fail = ((ret_value&0xffff0000)>>16);
+	FalseAlmCnt->Cnt_Crc8_fail = (ret_value & 0xffff0000)>>16;
 	ret_value = phy_query_bb_reg(adapter, ODM_REG_OFDM_FA_TYPE4_11N, bMaskDWord);
 	FalseAlmCnt->Cnt_Mcs_fail = (ret_value&0xffff);
 
@@ -757,7 +757,7 @@ void odm_FalseAlarmCounterStatistics(struct odm_dm_struct *pDM_Odm)
 
 	ret_value = phy_query_bb_reg(adapter, ODM_REG_SC_CNT_11N, bMaskDWord);
 	FalseAlmCnt->Cnt_BW_LSC = (ret_value&0xffff);
-	FalseAlmCnt->Cnt_BW_USC = ((ret_value&0xffff0000)>>16);
+	FalseAlmCnt->Cnt_BW_USC = (ret_value & 0xffff0000)>>16;
 
 	/* hold cck counter */
 	phy_set_bb_reg(adapter, ODM_REG_CCK_FA_RST_11N, BIT12, 1);
diff --git a/drivers/staging/rtl8188eu/hal/odm_HWConfig.c b/drivers/staging/rtl8188eu/hal/odm_HWConfig.c
index 29f87df..f8fae18 100644
--- a/drivers/staging/rtl8188eu/hal/odm_HWConfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_HWConfig.c
@@ -123,7 +123,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
 		/* 2011.11.28 LukeLee: 88E use different LNA & VGA gain table */
 		/* The RSSI formula should be modified according to the gain table */
 		/* In 88E, cck_highpwr is always set to 1 */
-		LNA_idx = ((cck_agc_rpt & 0xE0) >> 5);
+		LNA_idx = (cck_agc_rpt & 0xE0) >> 5;
 		VGA_idx = (cck_agc_rpt & 0x1F);
 		switch (LNA_idx) {
 		case 7:
diff --git a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
index 3222d8d..7904d22 100644
--- a/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
+++ b/drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c
@@ -596,7 +596,8 @@ void Hal_EfuseParseBoardType88E(struct adapter *pAdapter, u8 *hwinfo, bool AutoL
 	struct hal_data_8188e *pHalData = GET_HAL_DATA(pAdapter);
 
 	if (!AutoLoadFail)
-		pHalData->BoardType = ((hwinfo[EEPROM_RF_BOARD_OPTION_88E]&0xE0)>>5);
+		pHalData->BoardType = (hwinfo[EEPROM_RF_BOARD_OPTION_88E]
+					& 0xE0) >> 5;
 	else
 		pHalData->BoardType = 0;
 	DBG_88E("Board Type: 0x%2x\n", pHalData->BoardType);
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 07/13] staging: rtl8192e: remove extra parentheses around right bit shift operation
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (5 preceding siblings ...)
  2015-03-04  5:31 ` [PATCH 06/13] staging: rtl8188eu: remove extra parentheses around right bit shift operations Aya Mahfouz
@ 2015-03-04  5:32 ` Aya Mahfouz
  2015-03-04  5:33 ` [PATCH 08/13] staging: rtl8192u: " Aya Mahfouz
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:32 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operation.
The cases handled are  when the resultant value is assigned to
a variable or when a shift operation is carried out for a function
argument. The issues were detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Some coding style issues were handled manually to avoid
checkpatch warnings and errors.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 28 +++++++++++++-------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
index a85fb71..08735cb 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c
@@ -334,17 +334,17 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 	}
 
 	if (!priv->AutoloadFailFlag) {
-		priv->eeprom_vid = eprom_read(dev, (EEPROM_VID >> 1));
-		priv->eeprom_did = eprom_read(dev, (EEPROM_DID >> 1));
+		priv->eeprom_vid = eprom_read(dev, EEPROM_VID >> 1);
+		priv->eeprom_did = eprom_read(dev, EEPROM_DID >> 1);
 
 		usValue = eprom_read(dev, (u16)(EEPROM_Customer_ID>>1)) >> 8;
 		priv->eeprom_CustomerID = (u8)(usValue & 0xff);
-		usValue = eprom_read(dev, (EEPROM_ICVersion_ChannelPlan>>1));
+		usValue = eprom_read(dev, EEPROM_ICVersion_ChannelPlan>>1);
 		priv->eeprom_ChannelPlan = usValue&0xff;
-		IC_Version = ((usValue&0xff00)>>8);
+		IC_Version = (usValue & 0xff00)>>8;
 
 		ICVer8192 = (IC_Version&0xf);
-		ICVer8256 = ((IC_Version&0xf0)>>4);
+		ICVer8256 = (IC_Version & 0xf0)>>4;
 		RT_TRACE(COMP_INIT, "\nICVer8192 = 0x%x\n", ICVer8192);
 		RT_TRACE(COMP_INIT, "\nICVer8256 = 0x%x\n", ICVer8256);
 		if (ICVer8192 == 0x2) {
@@ -424,7 +424,7 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 		if (priv->epromtype == EEPROM_93C46) {
 			if (!priv->AutoloadFailFlag) {
 				usValue = eprom_read(dev,
-					  (EEPROM_TxPwDiff_CrystalCap >> 1));
+					  EEPROM_TxPwDiff_CrystalCap >> 1);
 				priv->EEPROMAntPwDiff = (usValue&0x0fff);
 				priv->EEPROMCrystalCap = (u8)((usValue & 0xf000)
 							 >> 12);
@@ -483,15 +483,15 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 					 priv->EEPROMLegacyHTTxPowerDiff;
 			priv->AntennaTxPwDiff[0] = (priv->EEPROMAntPwDiff &
 						    0xf);
-			priv->AntennaTxPwDiff[1] = ((priv->EEPROMAntPwDiff &
-						    0xf0)>>4);
-			priv->AntennaTxPwDiff[2] = ((priv->EEPROMAntPwDiff &
-						    0xf00)>>8);
+			priv->AntennaTxPwDiff[1] = (priv->EEPROMAntPwDiff &
+							0xf0) >> 4;
+			priv->AntennaTxPwDiff[2] = (priv->EEPROMAntPwDiff &
+							0xf00) >> 8;
 			priv->CrystalCap = priv->EEPROMCrystalCap;
 			priv->ThermalMeter[0] = (priv->EEPROMThermalMeter &
 						 0xf);
-			priv->ThermalMeter[1] = ((priv->EEPROMThermalMeter &
-						 0xf0)>>4);
+			priv->ThermalMeter[1] = (priv->EEPROMThermalMeter &
+						     0xf0) >> 4;
 		} else if (priv->epromtype == EEPROM_93C56) {
 
 			for (i = 0; i < 3; i++) {
@@ -548,8 +548,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 			priv->CrystalCap = priv->EEPROMCrystalCap;
 			priv->ThermalMeter[0] = (priv->EEPROMThermalMeter &
 						 0xf);
-			priv->ThermalMeter[1] = ((priv->EEPROMThermalMeter &
-						 0xf0)>>4);
+			priv->ThermalMeter[1] = (priv->EEPROMThermalMeter &
+						     0xf0) >> 4;
 		}
 	}
 
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 08/13] staging: rtl8192u: remove extra parentheses around right bit shift operation
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (6 preceding siblings ...)
  2015-03-04  5:32 ` [PATCH 07/13] staging: rtl8192e: remove extra parentheses around right bit shift operation Aya Mahfouz
@ 2015-03-04  5:33 ` Aya Mahfouz
  2015-03-04 17:09   ` [Outreachy kernel] " Julia Lawall
  2015-03-04  5:33 ` [PATCH 09/13] staging: rtl8712: " Aya Mahfouz
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:33 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operation.
The cases handled are when the resultant value is assigned to
a variable or when a shift operation is carried out for a function
argument. The issues were detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Some coding style issues were handled manually to avoid
checkpatch warnings and errors.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/rtl8192u/r8192U_core.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 9de4412..bab7751 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -2310,11 +2310,11 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 	}
 
 	if (bLoad_From_EEPOM) {
-		tmpValue = eprom_read(dev, (EEPROM_VID>>1));
+		tmpValue = eprom_read(dev, EEPROM_VID>>1);
 		priv->eeprom_vid = endian_swap(&tmpValue);
-		priv->eeprom_pid = eprom_read(dev, (EEPROM_PID>>1));
-		tmpValue = eprom_read(dev, (EEPROM_ChannelPlan>>1));
-		priv->eeprom_ChannelPlan = ((tmpValue&0xff00)>>8);
+		priv->eeprom_pid = eprom_read(dev, EEPROM_PID>>1);
+		tmpValue = eprom_read(dev, EEPROM_ChannelPlan>>1);
+		priv->eeprom_ChannelPlan = (tmpValue & 0xff00)>>8;
 		priv->btxpowerdata_readfromEEPORM = true;
 		priv->eeprom_CustomerID = eprom_read(dev, (EEPROM_Customer_ID>>1)) >>8;
 	} else {
@@ -2397,7 +2397,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 			}
 		} else if (priv->EEPROM_Def_Ver == 1) {
 			if (bLoad_From_EEPOM) {
-				tmpValue = eprom_read(dev, (EEPROM_TxPwIndex_CCK_V1>>1));
+				tmpValue = eprom_read(dev,
+						EEPROM_TxPwIndex_CCK_V1 >> 1);
 				tmpValue = (tmpValue & 0xff00) >> 8;
 			} else {
 				tmpValue = 0x10;
@@ -2410,7 +2411,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 				tmpValue = 0x1010;
 			*((u16 *)(&priv->EEPROMTxPowerLevelCCK_V1[1])) = tmpValue;
 			if (bLoad_From_EEPOM)
-				tmpValue = eprom_read(dev, (EEPROM_TxPwIndex_OFDM_24G_V1>>1));
+				tmpValue = eprom_read(dev,
+					EEPROM_TxPwIndex_OFDM_24G_V1 >> 1);
 			else
 				tmpValue = 0x1010;
 			*((u16 *)(&priv->EEPROMTxPowerLevelOFDM24G[0])) = tmpValue;
@@ -2453,7 +2455,7 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 		// Antenna B gain offset to antenna A, bit0~3
 		priv->AntennaTxPwDiff[0] = (priv->EEPROMTxPowerDiff & 0xf);
 		// Antenna C gain offset to antenna A, bit4~7
-		priv->AntennaTxPwDiff[1] = ((priv->EEPROMTxPowerDiff & 0xf0)>>4);
+		priv->AntennaTxPwDiff[1] = (priv->EEPROMTxPowerDiff & 0xf0)>>4;
 		// CrystalCap, bit12~15
 		priv->CrystalCap = priv->EEPROMCrystalCap;
 		// ThermalMeter, bit0~3 for RFIC1, bit4~7 for RFIC2
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 09/13] staging: rtl8712: remove extra parentheses around right bit shift operation
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (7 preceding siblings ...)
  2015-03-04  5:33 ` [PATCH 08/13] staging: rtl8192u: " Aya Mahfouz
@ 2015-03-04  5:33 ` Aya Mahfouz
  2015-03-04  5:34 ` [PATCH 10/13] staging: rtl8723au: remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:33 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operation.
The cases handled are  when the resultant value is assigned to
a variable or when a shift operation is carried out for a function
argument. The issues were detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/rtl8712/rtl8712_recv.c | 4 ++--
 drivers/staging/rtl8712/rtl871x_mp.c   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c
index 0ec0bda..50227b5 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -166,7 +166,7 @@ static void update_recvframe_attrib_from_recvstat(struct rx_pkt_attrib *pattrib,
 	 * Offset 0 */
 	pattrib->bdecrypted = ((le32_to_cpu(prxstat->rxdw0) & BIT(27)) >> 27)
 				 ? 0 : 1;
-	pattrib->crc_err = ((le32_to_cpu(prxstat->rxdw0) & BIT(14)) >> 14);
+	pattrib->crc_err = (le32_to_cpu(prxstat->rxdw0) & BIT(14)) >> 14;
 	/*Offset 4*/
 	/*Offset 8*/
 	/*Offset 12*/
@@ -435,7 +435,7 @@ void r8712_rxcmd_event_hdl(struct _adapter *padapter, void *prxcmdbuf)
 	poffset = (u8 *)prxcmdbuf;
 	voffset = *(uint *)poffset;
 	prxstat = (struct recv_stat *)prxcmdbuf;
-	drvinfo_sz = ((le32_to_cpu(prxstat->rxdw0) & 0x000f0000) >> 16);
+	drvinfo_sz = (le32_to_cpu(prxstat->rxdw0) & 0x000f0000) >> 16;
 	drvinfo_sz <<= 3;
 	poffset += RXDESC_SIZE + drvinfo_sz;
 	do {
diff --git a/drivers/staging/rtl8712/rtl871x_mp.c b/drivers/staging/rtl8712/rtl871x_mp.c
index 3d913b9..26201ea 100644
--- a/drivers/staging/rtl8712/rtl871x_mp.c
+++ b/drivers/staging/rtl8712/rtl871x_mp.c
@@ -327,8 +327,8 @@ void r8712_SetTxAGCOffset(struct _adapter *pAdapter, u32 ulTxAGCOffset)
 	u32 TxAGCOffset_B, TxAGCOffset_C, TxAGCOffset_D, tmpAGC;
 
 	TxAGCOffset_B = (ulTxAGCOffset&0x000000ff);
-	TxAGCOffset_C = ((ulTxAGCOffset&0x0000ff00)>>8);
-	TxAGCOffset_D = ((ulTxAGCOffset&0x00ff0000)>>16);
+	TxAGCOffset_C = (ulTxAGCOffset & 0x0000ff00)>>8;
+	TxAGCOffset_D = (ulTxAGCOffset & 0x00ff0000)>>16;
 	tmpAGC = (TxAGCOffset_D<<8 | TxAGCOffset_C<<4 | TxAGCOffset_B);
 	set_bb_reg(pAdapter, rFPGA0_TxGainStage,
 			(bXBTxAGC|bXCTxAGC|bXDTxAGC), tmpAGC);
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 10/13] staging: rtl8723au: remove extra parentheses around right bit shift operations
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (8 preceding siblings ...)
  2015-03-04  5:33 ` [PATCH 09/13] staging: rtl8712: " Aya Mahfouz
@ 2015-03-04  5:34 ` Aya Mahfouz
  2015-03-04  5:34 ` [PATCH 11/13] staging: slicoss: " Aya Mahfouz
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:34 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/rtl8723au/hal/odm.c               | 6 +++---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c
index 375f85d..e52a8e3 100644
--- a/drivers/staging/rtl8723au/hal/odm.c
+++ b/drivers/staging/rtl8723au/hal/odm.c
@@ -778,15 +778,15 @@ void odm_FalseAlarmCounterStatistics23a(struct dm_odm_t *pDM_Odm)
 	ret_value =
 		ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE1_11N, bMaskDWord);
 	FalseAlmCnt->Cnt_Fast_Fsync = (ret_value&0xffff);
-	FalseAlmCnt->Cnt_SB_Search_fail = ((ret_value&0xffff0000)>>16);
+	FalseAlmCnt->Cnt_SB_Search_fail = (ret_value & 0xffff0000)>>16;
 	ret_value =
 		ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE2_11N, bMaskDWord);
 	FalseAlmCnt->Cnt_OFDM_CCA = (ret_value&0xffff);
-	FalseAlmCnt->Cnt_Parity_Fail = ((ret_value&0xffff0000)>>16);
+	FalseAlmCnt->Cnt_Parity_Fail = (ret_value & 0xffff0000)>>16;
 	ret_value =
 		ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE3_11N, bMaskDWord);
 	FalseAlmCnt->Cnt_Rate_Illegal = (ret_value&0xffff);
-	FalseAlmCnt->Cnt_Crc8_fail = ((ret_value&0xffff0000)>>16);
+	FalseAlmCnt->Cnt_Crc8_fail = (ret_value & 0xffff0000)>>16;
 	ret_value =
 		ODM_GetBBReg(pDM_Odm, ODM_REG_OFDM_FA_TYPE4_11N, bMaskDWord);
 	FalseAlmCnt->Cnt_Mcs_fail = (ret_value&0xffff);
diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
index a5eadd4..3bf2f7b 100644
--- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
+++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
@@ -755,7 +755,7 @@ void rtl8723a_read_chip_version(struct rtw_adapter *padapter)
 
 	value32 = rtl8723au_read32(padapter, REG_GPIO_OUTSTS);
 	/*  ROM code version. */
-	ChipVersion.ROMVer = ((value32 & RF_RL_ID) >> 20);
+	ChipVersion.ROMVer = (value32 & RF_RL_ID) >> 20;
 
 	/*  For multi-function consideration. Added by Roger, 2010.10.06. */
 	pHalData->MultiFunc = RT_MULTI_FUNC_NONE;
@@ -1747,8 +1747,8 @@ Hal_EfuseParseBTCoexistInfo_8723A(struct rtw_adapter *padapter,
 		/*  eeprom spec */
 		tempval = hwinfo[RF_OPTION4_8723A];
 		pHalData->EEPROMBluetoothAntNum = (tempval & 0x1);
-		pHalData->EEPROMBluetoothAntIsolation = ((tempval & 0x10) >> 4);
-		pHalData->EEPROMBluetoothRadioShared = ((tempval & 0x20) >> 5);
+		pHalData->EEPROMBluetoothAntIsolation = (tempval & 0x10) >> 4;
+		pHalData->EEPROMBluetoothRadioShared = (tempval & 0x20) >> 5;
 	} else {
 		pHalData->EEPROMBluetoothCoexist = 0;
 		pHalData->EEPROMBluetoothType = BT_RTL8723A;
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 11/13] staging: slicoss: remove extra parentheses around right bit shift operations
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (9 preceding siblings ...)
  2015-03-04  5:34 ` [PATCH 10/13] staging: rtl8723au: remove extra parentheses around right bit shift operations Aya Mahfouz
@ 2015-03-04  5:34 ` Aya Mahfouz
  2015-03-04  5:35 ` [PATCH 12/13] staging: speakup: remove extra parentheses around right bit shift operation Aya Mahfouz
  2015-03-04  5:35 ` [PATCH 13/13] staging: xgifb: remove extra parentheses around right bit shift operations Aya Mahfouz
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:34 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Some coding style issues were handled manually to avoid
checkpatch warnings and errors.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/slicoss/slicoss.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 45f6a5f..c84dd60 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -164,7 +164,7 @@ static void slic_mcast_set_bit(struct adapter *adapter, char *address)
 	/* Get the CRC polynomial for the mac address */
 	/* we use bits 1-8 (lsb), bitwise reversed,
 	 * msb (= lsb bit 0 before bitrev) is automatically discarded */
-	crcpoly = (ether_crc(ETH_ALEN, address)>>23);
+	crcpoly = ether_crc(ETH_ALEN, address)>>23;
 
 	/* We only have space on the SLIC for 64 entries.  Lop
 	 * off the top two bits. (2^6 = 64)
@@ -1862,8 +1862,8 @@ static void slic_xmit_build_request(struct adapter *adapter,
 	hcmd->cmdsize = (u32) ((((u64)&ihcmd->u.slic_buffers.bufs[1] -
 				     (u64) hcmd) + 31) >> 5);
 #else
-	hcmd->cmdsize = ((((u32) &ihcmd->u.slic_buffers.bufs[1] -
-			   (u32) hcmd) + 31) >> 5);
+	hcmd->cmdsize = (((u32)&ihcmd->u.slic_buffers.bufs[1] -
+				       (u32)hcmd) + 31) >> 5;
 #endif
 }
 
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 12/13] staging: speakup: remove extra parentheses around right bit shift operation
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (10 preceding siblings ...)
  2015-03-04  5:34 ` [PATCH 11/13] staging: slicoss: " Aya Mahfouz
@ 2015-03-04  5:35 ` Aya Mahfouz
  2015-03-04  5:35 ` [PATCH 13/13] staging: xgifb: remove extra parentheses around right bit shift operations Aya Mahfouz
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:35 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operation.
The case handled is  when the resultant value is assigned to
a variable. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/speakup/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index e9f0c15..1249f91 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -1527,7 +1527,7 @@ static void update_color_buffer(struct vc_data *vc, const char *ic, int len)
 	int i, bi, hi;
 	int vc_num = vc->vc_num;
 
-	bi = ((vc->vc_attr & 0x70) >> 4);
+	bi = (vc->vc_attr & 0x70) >> 4;
 	hi = speakup_console[vc_num]->ht.highsize[bi];
 
 	i = 0;
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 13/13] staging: xgifb: remove extra parentheses around right bit shift operations
  2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
                   ` (11 preceding siblings ...)
  2015-03-04  5:35 ` [PATCH 12/13] staging: speakup: remove extra parentheses around right bit shift operation Aya Mahfouz
@ 2015-03-04  5:35 ` Aya Mahfouz
  12 siblings, 0 replies; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04  5:35 UTC (permalink / raw)
  To: outreachy-kernel

Removes extra parentheses around bitwise right shift operations.
The cases handled here are when resultant values are assigned to
variables. The issue was detected and resolved using the following
coccinelle script:

@@
expression e, e1;
constant c;
@@

e =
-(e1
+e1
>>
-c);
+c;

@@
identifier i;
constant c;
type t;
expression e;
@@

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

@@
expression e, e1;
identifier f;
constant c;
@@

e1 = f(...,
-(e
+e
>>
-c)
+c
,...);

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
---
 drivers/staging/xgifb/XGI_main_26.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c
index 935c714..74e8820 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -106,7 +106,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info *XGI_Pr,
 
 	sr_data = XGI_CRT1Table[index].CR[5];
 
-	HDE = (XGI330_RefIndex[RefreshRateTableIndex].XRes >> 3);
+	HDE = XGI330_RefIndex[RefreshRateTableIndex].XRes >> 3;
 
 	cr_data = XGI_CRT1Table[index].CR[3];
 
@@ -1011,8 +1011,8 @@ static int XGIfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
 			       XGIbios_mode[xgifb_info->mode_idx].mode_no);
 			return -EINVAL;
 		}
-		info->fix.line_length = ((info->var.xres_virtual
-				* info->var.bits_per_pixel) >> 6);
+		info->fix.line_length = (info->var.xres_virtual
+				* info->var.bits_per_pixel) >> 6;
 
 		xgifb_reg_set(XGISR, IND_SIS_PASSWORD, SIS_PASSWORD);
 
-- 
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [Outreachy kernel] [PATCH 08/13] staging: rtl8192u: remove extra parentheses around right bit shift operation
  2015-03-04  5:33 ` [PATCH 08/13] staging: rtl8192u: " Aya Mahfouz
@ 2015-03-04 17:09   ` Julia Lawall
  2015-03-04 17:57     ` Aya Mahfouz
  0 siblings, 1 reply; 17+ messages in thread
From: Julia Lawall @ 2015-03-04 17:09 UTC (permalink / raw)
  To: Aya Mahfouz; +Cc: outreachy-kernel

> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index 9de4412..bab7751 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -2310,11 +2310,11 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
>  	}
>
>  	if (bLoad_From_EEPOM) {
> -		tmpValue = eprom_read(dev, (EEPROM_VID>>1));
> +		tmpValue = eprom_read(dev, EEPROM_VID>>1);

Perhaps you could add some spaces around >> at the same time.

julia

>  		priv->eeprom_vid = endian_swap(&tmpValue);
> -		priv->eeprom_pid = eprom_read(dev, (EEPROM_PID>>1));
> -		tmpValue = eprom_read(dev, (EEPROM_ChannelPlan>>1));
> -		priv->eeprom_ChannelPlan = ((tmpValue&0xff00)>>8);
> +		priv->eeprom_pid = eprom_read(dev, EEPROM_PID>>1);
> +		tmpValue = eprom_read(dev, EEPROM_ChannelPlan>>1);
> +		priv->eeprom_ChannelPlan = (tmpValue & 0xff00)>>8;
>  		priv->btxpowerdata_readfromEEPORM = true;
>  		priv->eeprom_CustomerID = eprom_read(dev, (EEPROM_Customer_ID>>1)) >>8;
>  	} else {
> @@ -2397,7 +2397,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
>  			}
>  		} else if (priv->EEPROM_Def_Ver == 1) {
>  			if (bLoad_From_EEPOM) {
> -				tmpValue = eprom_read(dev, (EEPROM_TxPwIndex_CCK_V1>>1));
> +				tmpValue = eprom_read(dev,
> +						EEPROM_TxPwIndex_CCK_V1 >> 1);
>  				tmpValue = (tmpValue & 0xff00) >> 8;
>  			} else {
>  				tmpValue = 0x10;
> @@ -2410,7 +2411,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
>  				tmpValue = 0x1010;
>  			*((u16 *)(&priv->EEPROMTxPowerLevelCCK_V1[1])) = tmpValue;
>  			if (bLoad_From_EEPOM)
> -				tmpValue = eprom_read(dev, (EEPROM_TxPwIndex_OFDM_24G_V1>>1));
> +				tmpValue = eprom_read(dev,
> +					EEPROM_TxPwIndex_OFDM_24G_V1 >> 1);
>  			else
>  				tmpValue = 0x1010;
>  			*((u16 *)(&priv->EEPROMTxPowerLevelOFDM24G[0])) = tmpValue;
> @@ -2453,7 +2455,7 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
>  		// Antenna B gain offset to antenna A, bit0~3
>  		priv->AntennaTxPwDiff[0] = (priv->EEPROMTxPowerDiff & 0xf);
>  		// Antenna C gain offset to antenna A, bit4~7
> -		priv->AntennaTxPwDiff[1] = ((priv->EEPROMTxPowerDiff & 0xf0)>>4);
> +		priv->AntennaTxPwDiff[1] = (priv->EEPROMTxPowerDiff & 0xf0)>>4;
>  		// CrystalCap, bit12~15
>  		priv->CrystalCap = priv->EEPROMCrystalCap;
>  		// ThermalMeter, bit0~3 for RFIC1, bit4~7 for RFIC2
> --
> 1.9.3
>
>
> --
> Kind Regards,
> Aya Saif El-yazal Mahfouz
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/076f797b7a1c3417bb6fe5d027a4a21d5e33b072.1425446659.git.mahfouz.saif.elyazal%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Outreachy kernel] [PATCH 08/13] staging: rtl8192u: remove extra parentheses around right bit shift operation
  2015-03-04 17:09   ` [Outreachy kernel] " Julia Lawall
@ 2015-03-04 17:57     ` Aya Mahfouz
  2015-03-04 18:15       ` Julia Lawall
  0 siblings, 1 reply; 17+ messages in thread
From: Aya Mahfouz @ 2015-03-04 17:57 UTC (permalink / raw)
  To: Julia Lawall; +Cc: outreachy-kernel

On Wed, Mar 04, 2015 at 12:09:40PM -0500, Julia Lawall wrote:
> > diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> > index 9de4412..bab7751 100644
> > --- a/drivers/staging/rtl8192u/r8192U_core.c
> > +++ b/drivers/staging/rtl8192u/r8192U_core.c
> > @@ -2310,11 +2310,11 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
> >  	}
> >
> >  	if (bLoad_From_EEPOM) {
> > -		tmpValue = eprom_read(dev, (EEPROM_VID>>1));
> > +		tmpValue = eprom_read(dev, EEPROM_VID>>1);
> 
> Perhaps you could add some spaces around >> at the same time.
>
Yes, I realized the styling issue too, it can be found in many files.
Coders are not consistent when it comes to leaving spaces around
the >> and << operators and checkpatch does not complain. In addition,
checkpatch does not issue any warning about where an operator should
be if a statement is split into two or more lines
e.g.

s = a * 
   b;
is the same as 
s = a 
   * b;

I can send the styling issues handling in a separate patchset. If you
want me to resend the patchset again, let me know. It will however take
me some time.
   
> julia
> 
> >  		priv->eeprom_vid = endian_swap(&tmpValue);
> > -		priv->eeprom_pid = eprom_read(dev, (EEPROM_PID>>1));
> > -		tmpValue = eprom_read(dev, (EEPROM_ChannelPlan>>1));
> > -		priv->eeprom_ChannelPlan = ((tmpValue&0xff00)>>8);
> > +		priv->eeprom_pid = eprom_read(dev, EEPROM_PID>>1);
> > +		tmpValue = eprom_read(dev, EEPROM_ChannelPlan>>1);
> > +		priv->eeprom_ChannelPlan = (tmpValue & 0xff00)>>8;
> >  		priv->btxpowerdata_readfromEEPORM = true;
> >  		priv->eeprom_CustomerID = eprom_read(dev, (EEPROM_Customer_ID>>1)) >>8;
> >  	} else {
> > @@ -2397,7 +2397,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
> >  			}
> >  		} else if (priv->EEPROM_Def_Ver == 1) {
> >  			if (bLoad_From_EEPOM) {
> > -				tmpValue = eprom_read(dev, (EEPROM_TxPwIndex_CCK_V1>>1));
> > +				tmpValue = eprom_read(dev,
> > +						EEPROM_TxPwIndex_CCK_V1 >> 1);
> >  				tmpValue = (tmpValue & 0xff00) >> 8;
> >  			} else {
> >  				tmpValue = 0x10;
> > @@ -2410,7 +2411,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
> >  				tmpValue = 0x1010;
> >  			*((u16 *)(&priv->EEPROMTxPowerLevelCCK_V1[1])) = tmpValue;
> >  			if (bLoad_From_EEPOM)
> > -				tmpValue = eprom_read(dev, (EEPROM_TxPwIndex_OFDM_24G_V1>>1));
> > +				tmpValue = eprom_read(dev,
> > +					EEPROM_TxPwIndex_OFDM_24G_V1 >> 1);
> >  			else
> >  				tmpValue = 0x1010;
> >  			*((u16 *)(&priv->EEPROMTxPowerLevelOFDM24G[0])) = tmpValue;
> > @@ -2453,7 +2455,7 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
> >  		// Antenna B gain offset to antenna A, bit0~3
> >  		priv->AntennaTxPwDiff[0] = (priv->EEPROMTxPowerDiff & 0xf);
> >  		// Antenna C gain offset to antenna A, bit4~7
> > -		priv->AntennaTxPwDiff[1] = ((priv->EEPROMTxPowerDiff & 0xf0)>>4);
> > +		priv->AntennaTxPwDiff[1] = (priv->EEPROMTxPowerDiff & 0xf0)>>4;
> >  		// CrystalCap, bit12~15
> >  		priv->CrystalCap = priv->EEPROMCrystalCap;
> >  		// ThermalMeter, bit0~3 for RFIC1, bit4~7 for RFIC2
> > --
> > 1.9.3
> >
> >
> > --
> > Kind Regards,
> > Aya Saif El-yazal Mahfouz
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/076f797b7a1c3417bb6fe5d027a4a21d5e33b072.1425446659.git.mahfouz.saif.elyazal%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >

-- 
Kind Regards,
Aya Saif El-yazal Mahfouz


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [Outreachy kernel] [PATCH 08/13] staging: rtl8192u: remove extra parentheses around right bit shift operation
  2015-03-04 17:57     ` Aya Mahfouz
@ 2015-03-04 18:15       ` Julia Lawall
  0 siblings, 0 replies; 17+ messages in thread
From: Julia Lawall @ 2015-03-04 18:15 UTC (permalink / raw)
  To: Aya Mahfouz; +Cc: outreachy-kernel

On Wed, 4 Mar 2015, Aya Mahfouz wrote:

> On Wed, Mar 04, 2015 at 12:09:40PM -0500, Julia Lawall wrote:
> > > diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> > > index 9de4412..bab7751 100644
> > > --- a/drivers/staging/rtl8192u/r8192U_core.c
> > > +++ b/drivers/staging/rtl8192u/r8192U_core.c
> > > @@ -2310,11 +2310,11 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
> > >  	}
> > >
> > >  	if (bLoad_From_EEPOM) {
> > > -		tmpValue = eprom_read(dev, (EEPROM_VID>>1));
> > > +		tmpValue = eprom_read(dev, EEPROM_VID>>1);
> >
> > Perhaps you could add some spaces around >> at the same time.
> >
> Yes, I realized the styling issue too, it can be found in many files.
> Coders are not consistent when it comes to leaving spaces around
> the >> and << operators and checkpatch does not complain. In addition,
> checkpatch does not issue any warning about where an operator should
> be if a statement is split into two or more lines
> e.g.
>
> s = a *
>    b;
> is the same as
> s = a
>    * b;
>
> I can send the styling issues handling in a separate patchset. If you
> want me to resend the patchset again, let me know. It will however take
> me some time.

As you like.

julia

>
> > julia
> >
> > >  		priv->eeprom_vid = endian_swap(&tmpValue);
> > > -		priv->eeprom_pid = eprom_read(dev, (EEPROM_PID>>1));
> > > -		tmpValue = eprom_read(dev, (EEPROM_ChannelPlan>>1));
> > > -		priv->eeprom_ChannelPlan = ((tmpValue&0xff00)>>8);
> > > +		priv->eeprom_pid = eprom_read(dev, EEPROM_PID>>1);
> > > +		tmpValue = eprom_read(dev, EEPROM_ChannelPlan>>1);
> > > +		priv->eeprom_ChannelPlan = (tmpValue & 0xff00)>>8;
> > >  		priv->btxpowerdata_readfromEEPORM = true;
> > >  		priv->eeprom_CustomerID = eprom_read(dev, (EEPROM_Customer_ID>>1)) >>8;
> > >  	} else {
> > > @@ -2397,7 +2397,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
> > >  			}
> > >  		} else if (priv->EEPROM_Def_Ver == 1) {
> > >  			if (bLoad_From_EEPOM) {
> > > -				tmpValue = eprom_read(dev, (EEPROM_TxPwIndex_CCK_V1>>1));
> > > +				tmpValue = eprom_read(dev,
> > > +						EEPROM_TxPwIndex_CCK_V1 >> 1);
> > >  				tmpValue = (tmpValue & 0xff00) >> 8;
> > >  			} else {
> > >  				tmpValue = 0x10;
> > > @@ -2410,7 +2411,8 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
> > >  				tmpValue = 0x1010;
> > >  			*((u16 *)(&priv->EEPROMTxPowerLevelCCK_V1[1])) = tmpValue;
> > >  			if (bLoad_From_EEPOM)
> > > -				tmpValue = eprom_read(dev, (EEPROM_TxPwIndex_OFDM_24G_V1>>1));
> > > +				tmpValue = eprom_read(dev,
> > > +					EEPROM_TxPwIndex_OFDM_24G_V1 >> 1);
> > >  			else
> > >  				tmpValue = 0x1010;
> > >  			*((u16 *)(&priv->EEPROMTxPowerLevelOFDM24G[0])) = tmpValue;
> > > @@ -2453,7 +2455,7 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
> > >  		// Antenna B gain offset to antenna A, bit0~3
> > >  		priv->AntennaTxPwDiff[0] = (priv->EEPROMTxPowerDiff & 0xf);
> > >  		// Antenna C gain offset to antenna A, bit4~7
> > > -		priv->AntennaTxPwDiff[1] = ((priv->EEPROMTxPowerDiff & 0xf0)>>4);
> > > +		priv->AntennaTxPwDiff[1] = (priv->EEPROMTxPowerDiff & 0xf0)>>4;
> > >  		// CrystalCap, bit12~15
> > >  		priv->CrystalCap = priv->EEPROMCrystalCap;
> > >  		// ThermalMeter, bit0~3 for RFIC1, bit4~7 for RFIC2
> > > --
> > > 1.9.3
> > >
> > >
> > > --
> > > Kind Regards,
> > > Aya Saif El-yazal Mahfouz
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/076f797b7a1c3417bb6fe5d027a4a21d5e33b072.1425446659.git.mahfouz.saif.elyazal%40gmail.com.
> > > For more options, visit https://groups.google.com/d/optout.
> > >
>
> --
> Kind Regards,
> Aya Saif El-yazal Mahfouz
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20150304175729.GA4911%40waves.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-03-04 18:15 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-04  5:28 [PATCH 00/13] remove extra parentheses around right bit shift operations Aya Mahfouz
2015-03-04  5:28 ` [PATCH 01/13] staging: comedi: drivers: remove extra parentheses around right bit shift operation Aya Mahfouz
2015-03-04  5:29 ` [PATCH 02/13] staging: lustre: lclient: " Aya Mahfouz
2015-03-04  5:30 ` [PATCH 03/13] staging: lustre: llite: " Aya Mahfouz
2015-03-04  5:30 ` [PATCH 04/13] staging: media: bcm2048: " Aya Mahfouz
2015-03-04  5:31 ` [PATCH 05/13] staging: media: lirc: " Aya Mahfouz
2015-03-04  5:31 ` [PATCH 06/13] staging: rtl8188eu: remove extra parentheses around right bit shift operations Aya Mahfouz
2015-03-04  5:32 ` [PATCH 07/13] staging: rtl8192e: remove extra parentheses around right bit shift operation Aya Mahfouz
2015-03-04  5:33 ` [PATCH 08/13] staging: rtl8192u: " Aya Mahfouz
2015-03-04 17:09   ` [Outreachy kernel] " Julia Lawall
2015-03-04 17:57     ` Aya Mahfouz
2015-03-04 18:15       ` Julia Lawall
2015-03-04  5:33 ` [PATCH 09/13] staging: rtl8712: " Aya Mahfouz
2015-03-04  5:34 ` [PATCH 10/13] staging: rtl8723au: remove extra parentheses around right bit shift operations Aya Mahfouz
2015-03-04  5:34 ` [PATCH 11/13] staging: slicoss: " Aya Mahfouz
2015-03-04  5:35 ` [PATCH 12/13] staging: speakup: remove extra parentheses around right bit shift operation Aya Mahfouz
2015-03-04  5:35 ` [PATCH 13/13] staging: xgifb: remove extra parentheses around right bit shift operations Aya Mahfouz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.