staging: rtlwifi: Remove function that only returns the second argument

Because the odm_signal_scale_mapping function is only called to return the
second argument, remove the unnecessary function and change the statements
that call it, including removing unneeded braces and adding a blank line.

Note that removing casts (u8 to s32 and back to u8) will not lose
information because the value converted should be between 0 and 100.

Signed-off-by: Maya Nakamura <m.maya.nakamura@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Maya Nakamura 2018-10-27 03:15:03 -07:00 committed by Greg Kroah-Hartman
parent 2c66f2a9ef
commit 948569b72a
2 changed files with 17 additions and 40 deletions

View File

@ -477,18 +477,6 @@ static u8 odm_query_rx_pwr_percentage(s8 ant_power)
return 100 + ant_power; return 100 + ant_power;
} }
/*
* 2012/01/12 MH MOve some signal strength smooth method to MP HAL layer.
* IF other SW team do not support the feature, remove this section.??
*/
s32 odm_signal_scale_mapping(struct phy_dm_struct *dm, s32 curr_sig)
{
{
return curr_sig;
}
}
static u8 odm_sq_process_patch_rt_cid_819x_lenovo(struct phy_dm_struct *dm, static u8 odm_sq_process_patch_rt_cid_819x_lenovo(struct phy_dm_struct *dm,
u8 is_cck_rate, u8 pwdb_all, u8 is_cck_rate, u8 pwdb_all,
u8 path, u8 RSSI) u8 path, u8 RSSI)
@ -748,16 +736,10 @@ static void odm_rx_phy_status92c_series_parsing(
* from 0~100. * from 0~100.
*/ */
/* It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp(). */ /* It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp(). */
if (is_cck_rate) { if (is_cck_rate)
phy_info->signal_strength = (u8)( phy_info->signal_strength = pwdb_all;
odm_signal_scale_mapping(dm, pwdb_all)); /*pwdb_all;*/ else if (rf_rx_num != 0)
} else { phy_info->signal_strength = (total_rssi /= rf_rx_num);
if (rf_rx_num != 0) {
phy_info->signal_strength =
(u8)(odm_signal_scale_mapping(dm, total_rssi /=
rf_rx_num));
}
}
/* For 92C/92D HW (Hybrid) Antenna Diversity */ /* For 92C/92D HW (Hybrid) Antenna Diversity */
} }
@ -1051,10 +1033,8 @@ static void odm_rx_phy_status_jaguar_series_parsing(
*/ */
/*It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp().*/ /*It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp().*/
if (is_cck_rate) { if (is_cck_rate) {
phy_info->signal_strength = (u8)( phy_info->signal_strength = pwdb_all;
odm_signal_scale_mapping(dm, pwdb_all)); /*pwdb_all;*/ } else if (rf_rx_num != 0) {
} else {
if (rf_rx_num != 0) {
/* 2015/01 Sean, use the best two RSSI only, /* 2015/01 Sean, use the best two RSSI only,
* suggested by Ynlin and ChenYu. * suggested by Ynlin and ChenYu.
*/ */
@ -1062,10 +1042,10 @@ static void odm_rx_phy_status_jaguar_series_parsing(
avg_rssi = best_rssi; avg_rssi = best_rssi;
else else
avg_rssi = (best_rssi + second_rssi) / 2; avg_rssi = (best_rssi + second_rssi) / 2;
phy_info->signal_strength =
(u8)(odm_signal_scale_mapping(dm, avg_rssi)); phy_info->signal_strength = avg_rssi;
}
} }
dm->rx_pwdb_ave = dm->rx_pwdb_ave + phy_info->rx_pwdb_all; dm->rx_pwdb_ave = dm->rx_pwdb_ave + phy_info->rx_pwdb_all;
dm->dm_fat_table.antsel_rx_keep_0 = phy_sta_rpt->antidx_anta; dm->dm_fat_table.antsel_rx_keep_0 = phy_sta_rpt->antidx_anta;
@ -1874,8 +1854,7 @@ void phydm_rx_phy_status_new_type(struct phy_dm_struct *phydm, u8 *phy_status,
/* Update signal strength to UI, and phy_info->rx_pwdb_all is the /* Update signal strength to UI, and phy_info->rx_pwdb_all is the
* maximum RSSI of all path * maximum RSSI of all path
*/ */
phy_info->signal_strength = phy_info->signal_strength = phy_info->rx_pwdb_all;
(u8)(odm_signal_scale_mapping(phydm, phy_info->rx_pwdb_all));
/* Calculate average RSSI and smoothed RSSI */ /* Calculate average RSSI and smoothed RSSI */
phydm_process_rssi_for_dm_new_type(phydm, phy_info, pktinfo); phydm_process_rssi_for_dm_new_type(phydm, phy_info, pktinfo);

View File

@ -216,8 +216,6 @@ odm_config_fw_with_header_file(struct phy_dm_struct *dm,
u32 odm_get_hw_img_version(struct phy_dm_struct *dm); u32 odm_get_hw_img_version(struct phy_dm_struct *dm);
s32 odm_signal_scale_mapping(struct phy_dm_struct *dm, s32 curr_sig);
/*For 8822B only!! need to move to FW finally */ /*For 8822B only!! need to move to FW finally */
/*==============================================*/ /*==============================================*/
void phydm_rx_phy_status_new_type(struct phy_dm_struct *phydm, u8 *phy_status, void phydm_rx_phy_status_new_type(struct phy_dm_struct *phydm, u8 *phy_status,