From: Emmanuel Grumbach Date: Sun, 22 Dec 2013 08:55:47 +0000 (+0200) Subject: iwlwifi: mvm: fix harmless smatch / coccinelle warnings X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9e898f1bd4415699e826c78893a9622a11bd01a6;p=linux-beck.git iwlwifi: mvm: fix harmless smatch / coccinelle warnings Don't check if mvm->fw->cs is NULL since it can't be. cs is an array member of iwl_fw, it can't be NULL. Use memset(ptr, 0, sizeof(*ptr)); instead of memset(ptr, 0, sizeof(struct ptr_type)); Signed-off-by: Emmanuel Grumbach --- diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index b61d5a236ebe..e9eff30d76be 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c @@ -262,7 +262,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; /* currently FW API supports only one optional cipher scheme */ - if (mvm->fw->cs && mvm->fw->cs->cipher) { + if (mvm->fw->cs->cipher) { mvm->hw->n_cipher_schemes = 1; mvm->hw->cipher_schemes = mvm->fw->cs; } diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c index d6d28d7b442b..269fa0a4a382 100644 --- a/drivers/net/wireless/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/iwlwifi/mvm/rs.c @@ -700,7 +700,7 @@ static int rs_rate_from_ucode_rate(const u32 ucode_rate, u8 num_of_ant = get_num_of_ant_from_rate(ucode_rate); u8 nss; - memset(rate, 0, sizeof(struct rs_rate)); + memset(rate, 0, sizeof(*rate)); rate->index = iwl_hwrate_to_plcp_idx(ucode_rate); if (rate->index == IWL_RATE_INVALID) { @@ -2446,7 +2446,7 @@ static void rs_build_rates_table(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq_cmd = &lq_sta->lq; bool toggle_ant = false; - memcpy(&rate, initial_rate, sizeof(struct rs_rate)); + memcpy(&rate, initial_rate, sizeof(rate)); if (mvm) valid_tx_ant = iwl_fw_valid_tx_ant(mvm->fw);