* [PATCH 0/4] Staging: rtl8188eu: Cleanup code to increase compactness
@ 2015-03-02 6:22 Vatika Harlalka
2015-03-02 6:22 ` [PATCH 1/4] Staging: rtl8188eu: Remove redundant if condition clause Vatika Harlalka
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Vatika Harlalka @ 2015-03-02 6:22 UTC (permalink / raw)
To: outreachy-kernel
Remove unnecessary code to increase readability and
compactness.
Vatika Harlalka (4):
Staging: rtl8188eu: Remove redundant if condition clause
Staging: rtl8188eu: Remove unnecessary if condition
Staging: rtl8188eu: Remove dead code.
Staging: rtl8188eu: Change return type of function to void.
drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +-
drivers/staging/rtl8188eu/hal/phy.c | 53 ++++++++++------------------------
2 files changed, 16 insertions(+), 40 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] Staging: rtl8188eu: Remove redundant if condition clause
2015-03-02 6:22 [PATCH 0/4] Staging: rtl8188eu: Cleanup code to increase compactness Vatika Harlalka
@ 2015-03-02 6:22 ` Vatika Harlalka
2015-03-02 17:23 ` [Outreachy kernel] " Jes Sorensen
2015-03-02 6:22 ` [PATCH 2/4] Staging: rtl8188eu: Remove unnecessary if condition Vatika Harlalka
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Vatika Harlalka @ 2015-03-02 6:22 UTC (permalink / raw)
To: outreachy-kernel
Clause removed as !sim_bitmap is always true.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
drivers/staging/rtl8188eu/hal/phy.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 2af3013..2bbdcca 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -1025,7 +1025,7 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8],
diff = (tmp1 > tmp2) ? (tmp1 - tmp2) : (tmp2 - tmp1);
if (diff > MAX_TOLERANCE) {
- if ((i == 2 || i == 6) && !sim_bitmap) {
+ if (i == 2 || i == 6) {
if (resulta[c1][i] + resulta[c1][i+1] == 0)
final_candidate[(i/4)] = c2;
else if (resulta[c2][i] + resulta[c2][i+1] == 0)
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] Staging: rtl8188eu: Remove unnecessary if condition
2015-03-02 6:22 [PATCH 0/4] Staging: rtl8188eu: Cleanup code to increase compactness Vatika Harlalka
2015-03-02 6:22 ` [PATCH 1/4] Staging: rtl8188eu: Remove redundant if condition clause Vatika Harlalka
@ 2015-03-02 6:22 ` Vatika Harlalka
2015-03-02 6:22 ` [PATCH 3/4] Staging: rtl8188eu: Remove dead code Vatika Harlalka
2015-03-02 6:22 ` [PATCH 4/4] Staging: rtl8188eu: Change return type of function to void Vatika Harlalka
3 siblings, 0 replies; 6+ messages in thread
From: Vatika Harlalka @ 2015-03-02 6:22 UTC (permalink / raw)
To: outreachy-kernel
The variable final will never retain its original value of 0xff
so the else branch can be eliminated.
The loop is eliminated as the reg values are reassigned.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
drivers/staging/rtl8188eu/hal/phy.c | 47 +++++++++++--------------------------
1 file changed, 14 insertions(+), 33 deletions(-)
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 2bbdcca..8148201 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -1393,40 +1393,21 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
}
}
- for (i = 0; i < 4; i++) {
- reg_e94 = result[i][0];
- reg_e9c = result[i][1];
- reg_ea4 = result[i][2];
- reg_eac = result[i][3];
- reg_eb4 = result[i][4];
- reg_ebc = result[i][5];
- reg_ec4 = result[i][6];
- reg_ecc = result[i][7];
- }
+ reg_e94 = result[final][0];
+ reg_e9c = result[final][1];
+ reg_ea4 = result[final][2];
+ reg_eac = result[final][3];
+ reg_eb4 = result[final][4];
+ reg_ebc = result[final][5];
+ reg_ec4 = result[final][6];
+ reg_ecc = result[final][7];
+ pathaok = true;
+ pathbok = true;
+ dm_odm->RFCalibrateInfo.RegE94 = reg_e94;
+ dm_odm->RFCalibrateInfo.RegE9C = reg_e9c;
+ dm_odm->RFCalibrateInfo.RegEB4 = reg_eb4;
+ dm_odm->RFCalibrateInfo.RegEBC = reg_ebc;
- if (final != 0xff) {
- reg_e94 = result[final][0];
- reg_e9c = result[final][1];
- reg_ea4 = result[final][2];
- reg_eac = result[final][3];
- reg_eb4 = result[final][4];
- reg_ebc = result[final][5];
- dm_odm->RFCalibrateInfo.RegE94 = reg_e94;
- dm_odm->RFCalibrateInfo.RegE9C = reg_e9c;
- dm_odm->RFCalibrateInfo.RegEB4 = reg_eb4;
- dm_odm->RFCalibrateInfo.RegEBC = reg_ebc;
- reg_ec4 = result[final][6];
- reg_ecc = result[final][7];
- pathaok = true;
- pathbok = true;
- } else {
- ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
- ("IQK: FAIL use default value\n"));
- dm_odm->RFCalibrateInfo.RegE94 = 0x100;
- dm_odm->RFCalibrateInfo.RegEB4 = 0x100;
- dm_odm->RFCalibrateInfo.RegE9C = 0x0;
- dm_odm->RFCalibrateInfo.RegEBC = 0x0;
- }
if (reg_e94 != 0)
patha_fill_iqk(adapt, pathaok, result, final,
(reg_ea4 == 0));
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] Staging: rtl8188eu: Remove dead code.
2015-03-02 6:22 [PATCH 0/4] Staging: rtl8188eu: Cleanup code to increase compactness Vatika Harlalka
2015-03-02 6:22 ` [PATCH 1/4] Staging: rtl8188eu: Remove redundant if condition clause Vatika Harlalka
2015-03-02 6:22 ` [PATCH 2/4] Staging: rtl8188eu: Remove unnecessary if condition Vatika Harlalka
@ 2015-03-02 6:22 ` Vatika Harlalka
2015-03-02 6:22 ` [PATCH 4/4] Staging: rtl8188eu: Change return type of function to void Vatika Harlalka
3 siblings, 0 replies; 6+ messages in thread
From: Vatika Harlalka @ 2015-03-02 6:22 UTC (permalink / raw)
To: outreachy-kernel
The if condition is always false and the variables are
unused elsewhere in the code.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
drivers/staging/rtl8188eu/hal/phy.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index 8148201..6f05ff7 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -1327,7 +1327,6 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
s32 reg_e94, reg_e9c, reg_ea4, reg_eac, reg_eb4, reg_ebc, reg_ec4,
reg_ecc;
bool is12simular, is13simular, is23simular;
- bool singletone = false, carrier_sup = false;
u32 iqk_bb_reg_92c[IQK_BB_REG_NUM] = {
rOFDM0_XARxIQImbalance, rOFDM0_XBRxIQImbalance,
rOFDM0_ECCAThreshold, rOFDM0_AGCRSSITable,
@@ -1341,9 +1340,6 @@ void rtl88eu_phy_iq_calibrate(struct adapter *adapt, bool recovery)
if (!(dm_odm->SupportAbility & ODM_RF_CALIBRATION))
return;
- if (singletone || carrier_sup)
- return;
-
if (recovery) {
ODM_RT_TRACE(dm_odm, ODM_COMP_INIT, ODM_DBG_LOUD,
("phy_iq_calibrate: Return due to recovery!\n"));
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] Staging: rtl8188eu: Change return type of function to void.
2015-03-02 6:22 [PATCH 0/4] Staging: rtl8188eu: Cleanup code to increase compactness Vatika Harlalka
` (2 preceding siblings ...)
2015-03-02 6:22 ` [PATCH 3/4] Staging: rtl8188eu: Remove dead code Vatika Harlalka
@ 2015-03-02 6:22 ` Vatika Harlalka
3 siblings, 0 replies; 6+ messages in thread
From: Vatika Harlalka @ 2015-03-02 6:22 UTC (permalink / raw)
To: outreachy-kernel
Return is made void as the function return value is not used
when it is called.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c
index 2d3d012..bbda569 100644
--- a/drivers/staging/rtl8188eu/hal/bb_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c
@@ -398,7 +398,7 @@ static void rtl_bb_delay(struct adapter *adapt, u32 addr, u32 data)
}
}
-static bool set_baseband_phy_config(struct adapter *adapt)
+static void set_baseband_phy_config(struct adapter *adapt)
{
u32 i;
u32 arraylen = sizeof(array_phy_reg_1t_8188e)/sizeof(u32);
@@ -411,7 +411,6 @@ static bool set_baseband_phy_config(struct adapter *adapt)
if (v1 < 0xCDCDCDCD)
rtl_bb_delay(adapt, v1, v2);
}
- return true;
}
/* PHY_REG_PG.TXT */
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Outreachy kernel] [PATCH 1/4] Staging: rtl8188eu: Remove redundant if condition clause
2015-03-02 6:22 ` [PATCH 1/4] Staging: rtl8188eu: Remove redundant if condition clause Vatika Harlalka
@ 2015-03-02 17:23 ` Jes Sorensen
0 siblings, 0 replies; 6+ messages in thread
From: Jes Sorensen @ 2015-03-02 17:23 UTC (permalink / raw)
To: Vatika Harlalka, outreachy-kernel
On 03/02/15 01:22, Vatika Harlalka wrote:
> Clause removed as !sim_bitmap is always true.
>
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
> drivers/staging/rtl8188eu/hal/phy.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
> index 2af3013..2bbdcca 100644
> --- a/drivers/staging/rtl8188eu/hal/phy.c
> +++ b/drivers/staging/rtl8188eu/hal/phy.c
> @@ -1025,7 +1025,7 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8],
> diff = (tmp1 > tmp2) ? (tmp1 - tmp2) : (tmp2 - tmp1);
>
> if (diff > MAX_TOLERANCE) {
> - if ((i == 2 || i == 6) && !sim_bitmap) {
> + if (i == 2 || i == 6) {
> if (resulta[c1][i] + resulta[c1][i+1] == 0)
> final_candidate[(i/4)] = c2;
> else if (resulta[c2][i] + resulta[c2][i+1] == 0)
>
How do you come to the conclusion that !sim_bitmap is always true here?
This is inside a for() loop, and once i > 0, sim_bitmap could be != 0.
NACK
Cheers,
Jes
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-03-02 17:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-02 6:22 [PATCH 0/4] Staging: rtl8188eu: Cleanup code to increase compactness Vatika Harlalka
2015-03-02 6:22 ` [PATCH 1/4] Staging: rtl8188eu: Remove redundant if condition clause Vatika Harlalka
2015-03-02 17:23 ` [Outreachy kernel] " Jes Sorensen
2015-03-02 6:22 ` [PATCH 2/4] Staging: rtl8188eu: Remove unnecessary if condition Vatika Harlalka
2015-03-02 6:22 ` [PATCH 3/4] Staging: rtl8188eu: Remove dead code Vatika Harlalka
2015-03-02 6:22 ` [PATCH 4/4] Staging: rtl8188eu: Change return type of function to void Vatika Harlalka
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.