From: Vatika Harlalka <vatikaharlalka@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: [PATCH] Staging: rtl8188eu: Remove unnecessary if condition
Date: Sat, 28 Feb 2015 01:00:15 +0530 [thread overview]
Message-ID: <20150227193015.GA30908@gmail.com> (raw)
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 d5b5998..b6b6b0b 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -1418,40 +1418,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];
+ dm_odm->RFCalibrateInfo.RegE94 = reg_e94;
+ dm_odm->RFCalibrateInfo.RegE9C = reg_e9c;
+ dm_odm->RFCalibrateInfo.RegEB4 = reg_eb4;
+ dm_odm->RFCalibrateInfo.RegEBC = reg_ebc;
+ pathaok = true;
+ pathbok = true;
- 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
next reply other threads:[~2015-02-27 19:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-27 19:30 Vatika Harlalka [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-02-26 20:09 [PATCH] Staging: rtl8188eu: Remove unnecessary if condition Vatika Harlalka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150227193015.GA30908@gmail.com \
--to=vatikaharlalka@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.