diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-01-08 13:16:33 +0100 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-01-13 22:17:20 +0200 |
commit | 65b30348dbf9b529901b5c2b62dca6cad9017a2a (patch) | |
tree | e5a8c4704d58a8ff74150e099e57a46f10860c09 /drivers/net/wireless/iwlwifi/mvm/utils.c | |
parent | e36b766d0c674c9dc73a2ace7aa37aea78afa233 (diff) | |
download | linux-65b30348dbf9b529901b5c2b62dca6cad9017a2a.tar.gz linux-65b30348dbf9b529901b5c2b62dca6cad9017a2a.tar.bz2 linux-65b30348dbf9b529901b5c2b62dca6cad9017a2a.zip |
iwlwifi: add inline helper for packet lengths
Add an inline helper function for getting an RX packet's
length or payload length and use it throughout the code
(most of which I did using an spatch.)
While at it, adjust some code, and remove a bogus comment
from the dvm calibration code.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/utils.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c index 487d61b25359..a4a5e25623c3 100644 --- a/drivers/net/wireless/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/iwlwifi/mvm/utils.c @@ -168,8 +168,8 @@ int iwl_mvm_send_cmd_status(struct iwl_mvm *mvm, struct iwl_host_cmd *cmd, goto out_free_resp; } - resp_len = le32_to_cpu(pkt->len_n_flags) & FH_RSCSR_FRAME_SIZE_MSK; - if (WARN_ON_ONCE(resp_len != sizeof(pkt->hdr) + sizeof(*resp))) { + resp_len = iwl_rx_packet_payload_len(pkt); + if (WARN_ON_ONCE(resp_len != sizeof(*resp))) { ret = -EIO; goto out_free_resp; } |