wifi: iwlwifi: mvm: prefer RCU_INIT_POINTER()
authorJohannes Berg <johannes.berg@intel.com>
Tue, 18 Apr 2023 09:28:09 +0000 (12:28 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 20 Apr 2023 09:45:55 +0000 (11:45 +0200)
For constant values we don't need rcu_assign_pointer(),
use RCU_INIT_POINTER() instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230418122405.7b400d21a27f.Iccdef9d777677390a9881c88b06c0ed13a83d978@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/sta.c

index ac63af54941636944511c9cf800ca46735765fe8..51399284e097a6709ccf4e533bf50e309e049704 100644 (file)
@@ -3314,8 +3314,8 @@ void iwl_mvm_sta_pre_rcu_remove(struct ieee80211_hw *hw,
                                                     lockdep_is_held(&mvm->mutex));
                sta_id = link_sta->sta_id;
                if (sta == rcu_access_pointer(mvm->fw_id_to_mac_id[sta_id])) {
-                       rcu_assign_pointer(mvm->fw_id_to_mac_id[sta_id],
-                                          ERR_PTR(-ENOENT));
+                       RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta_id],
+                                        ERR_PTR(-ENOENT));
                        RCU_INIT_POINTER(mvm->fw_id_to_link_sta[sta_id], NULL);
                }
        }
index d323d119c3346e0264b28e033dcc8dceea59e782..5469d634e28998a12b2c9bd2fefde11dbddbdd0a 100644 (file)
@@ -2152,7 +2152,7 @@ int iwl_mvm_allocate_int_sta(struct iwl_mvm *mvm,
        sta->type = type;
 
        /* put a non-NULL value so iterating over the stations won't stop */
-       rcu_assign_pointer(mvm->fw_id_to_mac_id[sta->sta_id], ERR_PTR(-EINVAL));
+       RCU_INIT_POINTER(mvm->fw_id_to_mac_id[sta->sta_id], ERR_PTR(-EINVAL));
        return 0;
 }