Skip to contentSkip to conversation

remove extra parentheses around right bit shift operations

PATCH In review Aya Mahfouz 2 participants 17 messages Mar 4, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover remove extra parentheses around right bit shift operations

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(-)
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#1 lore raw

PATCH 1/13 staging: comedi: drivers: remove extra parentheses around right bit shift operation

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

---
 drivers/staging/comedi/drivers/dt2801.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/dt2801.c +1 -1
index b96e60f..7e565fc 100644
@@ -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;
 
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#2 lore raw

PATCH 2/13 staging: lustre: lclient: remove extra parentheses around right bit shift operation

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

---
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/lclient/lcommon_cl.c +3 -2
index 23095bb..ab6cb41 100644
@@ -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;
 }
 
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#3 lore raw

PATCH 3/13 staging: lustre: llite: remove extra parentheses around right bit shift operation

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

---
 drivers/staging/lustre/lustre/llite/vvp_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/llite/vvp_dev.c +1 -1
index 5a1078a..97d94fc 100644
@@ -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)
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#4 lore raw

PATCH 4/13 staging: media: bcm2048: remove extra parentheses around right bit shift operation

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

---
 drivers/staging/media/bcm2048/radio-bcm2048.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/media/bcm2048/radio-bcm2048.c +1 -2
index 5382506..116251b 100644
@@ -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;
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#5 lore raw

PATCH 5/13 staging: media: lirc: remove extra parentheses around right bit shift operation

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

---
 drivers/staging/media/lirc/lirc_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/lirc/lirc_serial.c +1 -1
index 19628d0..9f55a83 100644
@@ -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,
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#6 lore raw

PATCH 6/13 staging: rtl8188eu: remove extra parentheses around right bit shift operations

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

---
 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(-)
drivers/staging/rtl8188eu/core/rtw_efuse.c +1 -1
index 8816d11..defec6b 100644
@@ -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++;
drivers/staging/rtl8188eu/hal/odm.c +4 -4
index 06477e8..28b5e7b 100644
@@ -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);
drivers/staging/rtl8188eu/hal/odm_HWConfig.c +1 -1
index 29f87df..f8fae18 100644
@@ -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:
drivers/staging/rtl8188eu/hal/rtl8188e_hal_init.c +2 -1
index 3222d8d..7904d22 100644
@@ -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);
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#7 lore raw

PATCH 7/13 staging: rtl8192e: remove extra parentheses around right bit shift operation

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

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

---
 drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 28 +++++++++++++-------------
 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +14 -14
index a85fb71..08735cb 100644
@@ -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;
 		}
 	}
 
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#8 lore raw

PATCH 8/13 staging: rtl8192u: remove extra parentheses around right bit shift operation

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

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

---
 drivers/staging/rtl8192u/r8192U_core.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/staging/rtl8192u/r8192U_core.c +9 -7
index 9de4412..bab7751 100644
@@ -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
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#12 lore raw

PATCH 9/13 staging: rtl8712: remove extra parentheses around right bit shift operation

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

---
 drivers/staging/rtl8712/rtl8712_recv.c | 4 ++--
 drivers/staging/rtl8712/rtl871x_mp.c   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8712/rtl8712_recv.c +2 -2
index 0ec0bda..50227b5 100644
@@ -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 {
drivers/staging/rtl8712/rtl871x_mp.c +2 -2
index 3d913b9..26201ea 100644
@@ -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);
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#13 lore raw

PATCH 10/13 staging: rtl8723au: remove extra parentheses around right bit shift operations

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

---
 drivers/staging/rtl8723au/hal/odm.c               | 6 +++---
 drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723au/hal/odm.c +3 -3
index 375f85d..e52a8e3 100644
@@ -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);
drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +3 -3
index a5eadd4..3bf2f7b 100644
@@ -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;
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#14 lore raw

PATCH 11/13 staging: slicoss: remove extra parentheses around right bit shift operations

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

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

---
 drivers/staging/slicoss/slicoss.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/slicoss/slicoss.c +3 -3
index 45f6a5f..c84dd60 100644
@@ -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
 }
 
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#15 lore raw

PATCH 12/13 staging: speakup: remove extra parentheses around right bit shift operation

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

---
 drivers/staging/speakup/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/speakup/main.c +1 -1
index e9f0c15..1249f91 100644
@@ -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;
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#16 lore raw

PATCH 13/13 staging: xgifb: remove extra parentheses around right bit shift operations

In reply to Aya Mahfouz

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

Quoted 1 line
Quoted 1 line

-c);
+c;

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

t i =
-(e
+e

Quoted 1 line
Quoted 1 line

-c);
+c;

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

e1 = f(...,
-(e
+e

Quoted 1 line
Quoted 1 line

-c)
+c
,...);

---
 drivers/staging/xgifb/XGI_main_26.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/xgifb/XGI_main_26.c +3 -3
index 935c714..74e8820 100644
@@ -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);
 
Signature · 6 lines
1.9.3


-- 
Kind Regards,
Aya Saif El-yazal Mahfouz
#9 lore raw

Re: [Outreachy kernel] [PATCH 08/13] staging: rtl8192u: remove extra parentheses around right bit shift operation

In reply to Aya Mahfouz

drivers/staging/rtl8192u/r8192U_core.c static void rtl8192_read_eeprom_info(struct net_device *dev) · line 2313

Quoted 10 lines
drivers/staging/rtl8192u/r8192U_core.c +1 -1
index 9de4412..bab7751 100644
@@ -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

Quoted 54 lines
drivers/staging/rtl8192u/r8192U_core.c +8 -7
 		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 [email protected].
To post to this group, send email to [email protected].
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.

#10 lore raw

Re: [Outreachy kernel] [PATCH 08/13] staging: rtl8192u: remove extra parentheses around right bit shift operation

Quoted 7 lines · Julia Lawall
Quoted 7 lines
drivers/staging/rtl8192u/r8192U_core.c +0 -0
index 9de4412..bab7751 100644
@@ -2310,11 +2310,11 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 	}
 
Quoted 6 lines

drivers/staging/rtl8192u/r8192U_core.c static void rtl8192_read_eeprom_info(struct net_device *dev) · line 2313

Quoted 3 lines
drivers/staging/rtl8192u/r8192U_core.c +1 -1
 	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.

Quoted 56 lines

julia

Quoted 54 lines
drivers/staging/rtl8192u/r8192U_core.c +8 -7
 		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 [email protected].
To post to this group, send email to [email protected].
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.

Signature · 2 lines
Kind Regards,
Aya Saif El-yazal Mahfouz
#11 lore raw

Re: [Outreachy kernel] [PATCH 08/13] staging: rtl8192u: remove extra parentheses around right bit shift operation

Quoted 27 lines · Aya Mahfouz
Quoted 7 lines · Julia Lawall
Quoted 7 lines
drivers/staging/rtl8192u/r8192U_core.c +0 -0
index 9de4412..bab7751 100644
@@ -2310,11 +2310,11 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
 	}
 
Quoted 6 lines

drivers/staging/rtl8192u/r8192U_core.c static void rtl8192_read_eeprom_info(struct net_device *dev) · line 2313

Quoted 3 lines
drivers/staging/rtl8192u/r8192U_core.c +1 -1
 	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;

Quoted 3 lines

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

Quoted 69 lines
Quoted 50 lines

julia

Quoted 47 lines
drivers/staging/rtl8192u/r8192U_core.c +8 -7
 		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

Quoted 7 lines
Quoted 7 lines

--
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 [email protected].
To post to this group, send email to [email protected].
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 [email protected]. To post to this group, send email to [email protected].
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.