summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVatika Harlalka <vatikaharlalka@gmail.com>2015-02-26 23:05:11 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-26 12:56:58 -0800
commit294a7fcc85f5fbfdec782c5fad590b49735a35c4 (patch)
treeae33695e53ac5f9f22549de531993a995ff8468f /drivers
parent4ceb7f723372336f4d9e1ccfe7697a08eff2860f (diff)
downloadlinux-294a7fcc85f5fbfdec782c5fad590b49735a35c4.tar.gz
linux-294a7fcc85f5fbfdec782c5fad590b49735a35c4.tar.bz2
linux-294a7fcc85f5fbfdec782c5fad590b49735a35c4.zip
Staging: rtl8188eu: Refactor conditional code to increase readability
Remove the nested conditionals. The if and else-if have the same code so they are combined to make the code more compact. Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/rtl8188eu/hal/phy.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/staging/rtl8188eu/hal/phy.c b/drivers/staging/rtl8188eu/hal/phy.c
index d94ce61647b6..c8d8abcde16d 100644
--- a/drivers/staging/rtl8188eu/hal/phy.c
+++ b/drivers/staging/rtl8188eu/hal/phy.c
@@ -506,18 +506,12 @@ void rtl88eu_dm_txpower_tracking_callback_thermalmeter(struct adapter *adapt)
temp_cck = dm_odm->RFCalibrateInfo.RegA24;
for (i = 0; i < CCK_TABLE_SIZE; i++) {
- if (dm_odm->RFCalibrateInfo.bCCKinCH14) {
- if (memcmp(&temp_cck, &CCKSwingTable_Ch14[i][2], 4)) {
+ if ((dm_odm->RFCalibrateInfo.bCCKinCH14 &&
+ memcmp(&temp_cck, &CCKSwingTable_Ch14[i][2], 4)) ||
+ memcmp(&temp_cck, &CCKSwingTable_Ch1_Ch13[i][2], 4)) {
cck_index_old = (u8)i;
dm_odm->BbSwingIdxCckBase = (u8)i;
break;
- }
- } else {
- if (memcmp(&temp_cck, &CCKSwingTable_Ch1_Ch13[i][2], 4)) {
- cck_index_old = (u8)i;
- dm_odm->BbSwingIdxCckBase = (u8)i;
- break;
- }
}
}