summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h
diff options
context:
space:
mode:
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>2022-01-28 15:30:51 +0300
committerKalle Valo <kvalo@kernel.org>2022-02-03 11:24:47 +0300
commit973f02c932b0be41a26bb9bdf38b7b92721611d2 (patch)
tree35752dd882d35159b00821fca4c717a43c6ba77c /drivers/net/wireless/intel/iwlwifi/fw/api/rs.h
parentbe8287c9b8326d767429c8371bbc78b33f6efe13 (diff)
downloadlinux-973f02c932b0be41a26bb9bdf38b7b92721611d2.tar.xz
iwlwifi: fix iwl_legacy_rate_to_fw_idx
There are a couple of bugs in this function: 1. It is declared as a non-static function, even though it's only used in one file. 2. Its return value should be of type u32 but it returns (in some cases) -1. Fix them by making this function static and returning an error value of type unsigned. In addition, we're assigning the return value of this function as the legacy rate even if the function returned an error value. Fix this by assigning the lowest rate in this case. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Reported-by: Ye Guojin <ye.guojin@zte.com.cn> Reported-by: Zeal Robot <zealci@zte.com.cn> Fixes: 9998f81e4ba5 ("iwlwifi: mvm: convert old rate & flags to the new format.") Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/iwlwifi.20220128142706.5612eeb9d6d0.I992e10d93fc22919b2bc42daad087ee1b5d6f014@changeid
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/fw/api/rs.h')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/fw/api/rs.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h b/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h
index 173a6991587b..4a7723eb8c1d 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/rs.h
@@ -752,7 +752,6 @@ struct iwl_lq_cmd {
u8 iwl_fw_rate_idx_to_plcp(int idx);
u32 iwl_new_rate_from_v1(u32 rate_v1);
-u32 iwl_legacy_rate_to_fw_idx(u32 rate_n_flags);
const struct iwl_rate_mcs_info *iwl_rate_mcs(int idx);
const char *iwl_rs_pretty_ant(u8 ant);
const char *iwl_rs_pretty_bw(int bw);