diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-08-06 10:17:53 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-06 13:53:58 -0400 |
commit | a24d52f390a77ce90dc8cf0cd75d27ec0a6ea3f8 (patch) | |
tree | 22bd26711179036d5c417ec5fc0c56de82fe0a07 /drivers | |
parent | e95b743536937a72e1560c85696b425c5d1a1c18 (diff) |
iwlwifi: fix locking assertions
spin_is_locked() can return zero on some (UP?)
configurations because locks don't exist, and
that causes an endless amount of warnings. Use
lockdep_assert_held() instead, which has two
advantages:
1) it verifies the current task is holding
the lock or mutex
2) it compiles away completely when lockdep
is not enabled
Cc: stable@kernel.org [2.6.34+, maybe only parts of patch]
Reported-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c index a1b6d202d57c..9dd9e64c2b0b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c | |||
@@ -1429,7 +1429,7 @@ int iwlagn_manage_ibss_station(struct iwl_priv *priv, | |||
1429 | void iwl_free_tfds_in_queue(struct iwl_priv *priv, | 1429 | void iwl_free_tfds_in_queue(struct iwl_priv *priv, |
1430 | int sta_id, int tid, int freed) | 1430 | int sta_id, int tid, int freed) |
1431 | { | 1431 | { |
1432 | WARN_ON(!spin_is_locked(&priv->sta_lock)); | 1432 | lockdep_assert_held(&priv->sta_lock); |
1433 | 1433 | ||
1434 | if (priv->stations[sta_id].tid[tid].tfds_in_queue >= freed) | 1434 | if (priv->stations[sta_id].tid[tid].tfds_in_queue >= freed) |
1435 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; | 1435 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c index ecb953f28068..d04502d54df3 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c | |||
@@ -1117,7 +1117,7 @@ int iwlagn_txq_check_empty(struct iwl_priv *priv, | |||
1117 | u8 *addr = priv->stations[sta_id].sta.sta.addr; | 1117 | u8 *addr = priv->stations[sta_id].sta.sta.addr; |
1118 | struct iwl_tid_data *tid_data = &priv->stations[sta_id].tid[tid]; | 1118 | struct iwl_tid_data *tid_data = &priv->stations[sta_id].tid[tid]; |
1119 | 1119 | ||
1120 | WARN_ON(!spin_is_locked(&priv->sta_lock)); | 1120 | lockdep_assert_held(&priv->sta_lock); |
1121 | 1121 | ||
1122 | switch (priv->stations[sta_id].tid[tid].agg.state) { | 1122 | switch (priv->stations[sta_id].tid[tid].agg.state) { |
1123 | case IWL_EMPTYING_HW_QUEUE_DELBA: | 1123 | case IWL_EMPTYING_HW_QUEUE_DELBA: |
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index b0c6b0473901..a4b3663a262f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -298,7 +298,7 @@ EXPORT_SYMBOL(iwl_init_scan_params); | |||
298 | 298 | ||
299 | static int iwl_scan_initiate(struct iwl_priv *priv, struct ieee80211_vif *vif) | 299 | static int iwl_scan_initiate(struct iwl_priv *priv, struct ieee80211_vif *vif) |
300 | { | 300 | { |
301 | WARN_ON(!mutex_is_locked(&priv->mutex)); | 301 | lockdep_assert_held(&priv->mutex); |
302 | 302 | ||
303 | IWL_DEBUG_INFO(priv, "Starting scan...\n"); | 303 | IWL_DEBUG_INFO(priv, "Starting scan...\n"); |
304 | set_bit(STATUS_SCANNING, &priv->status); | 304 | set_bit(STATUS_SCANNING, &priv->status); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 9511f03f07e0..7e0829be5e78 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -773,7 +773,7 @@ static int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty) | |||
773 | 773 | ||
774 | int iwl_restore_default_wep_keys(struct iwl_priv *priv) | 774 | int iwl_restore_default_wep_keys(struct iwl_priv *priv) |
775 | { | 775 | { |
776 | WARN_ON(!mutex_is_locked(&priv->mutex)); | 776 | lockdep_assert_held(&priv->mutex); |
777 | 777 | ||
778 | return iwl_send_static_wepkey_cmd(priv, 0); | 778 | return iwl_send_static_wepkey_cmd(priv, 0); |
779 | } | 779 | } |
@@ -784,7 +784,7 @@ int iwl_remove_default_wep_key(struct iwl_priv *priv, | |||
784 | { | 784 | { |
785 | int ret; | 785 | int ret; |
786 | 786 | ||
787 | WARN_ON(!mutex_is_locked(&priv->mutex)); | 787 | lockdep_assert_held(&priv->mutex); |
788 | 788 | ||
789 | IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n", | 789 | IWL_DEBUG_WEP(priv, "Removing default WEP key: idx=%d\n", |
790 | keyconf->keyidx); | 790 | keyconf->keyidx); |
@@ -808,7 +808,7 @@ int iwl_set_default_wep_key(struct iwl_priv *priv, | |||
808 | { | 808 | { |
809 | int ret; | 809 | int ret; |
810 | 810 | ||
811 | WARN_ON(!mutex_is_locked(&priv->mutex)); | 811 | lockdep_assert_held(&priv->mutex); |
812 | 812 | ||
813 | if (keyconf->keylen != WEP_KEY_LEN_128 && | 813 | if (keyconf->keylen != WEP_KEY_LEN_128 && |
814 | keyconf->keylen != WEP_KEY_LEN_64) { | 814 | keyconf->keylen != WEP_KEY_LEN_64) { |