diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-04-06 07:12:38 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-04-16 16:46:50 -0400 |
commit | 6708dc863880777ffe5fc55c86bfd80f886f53d6 (patch) | |
tree | 46fb6d2f844ab2f26a35c7a42eddf53e8779d8c8 /drivers | |
parent | 00700ee007cf842ef2eb20201080ceddcfdaf9ad (diff) |
iwlwifi: correct atomic bitops usage
With atomic bitops, test_and_{set,clear}_bit
should be used instead of separate test_bit
and set_bit/clear_bit.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-scan.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c index 3904bb45ca61..7982b1930763 100644 --- a/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/drivers/net/wireless/iwlwifi/iwl-scan.c | |||
@@ -68,9 +68,8 @@ int iwl_scan_cancel(struct iwl_priv *priv) | |||
68 | } | 68 | } |
69 | 69 | ||
70 | if (test_bit(STATUS_SCANNING, &priv->status)) { | 70 | if (test_bit(STATUS_SCANNING, &priv->status)) { |
71 | if (!test_bit(STATUS_SCAN_ABORTING, &priv->status)) { | 71 | if (!test_and_set_bit(STATUS_SCAN_ABORTING, &priv->status)) { |
72 | IWL_DEBUG_SCAN(priv, "Queuing scan abort.\n"); | 72 | IWL_DEBUG_SCAN(priv, "Queuing scan abort.\n"); |
73 | set_bit(STATUS_SCAN_ABORTING, &priv->status); | ||
74 | queue_work(priv->workqueue, &priv->abort_scan); | 73 | queue_work(priv->workqueue, &priv->abort_scan); |
75 | 74 | ||
76 | } else | 75 | } else |
@@ -227,13 +226,13 @@ static void iwl_rx_scan_complete_notif(struct iwl_priv *priv, | |||
227 | jiffies_to_msecs(elapsed_jiffies | 226 | jiffies_to_msecs(elapsed_jiffies |
228 | (priv->scan_pass_start, jiffies))); | 227 | (priv->scan_pass_start, jiffies))); |
229 | 228 | ||
230 | /* If a request to abort was given, or the scan did not succeed | 229 | /* |
230 | * If a request to abort was given, or the scan did not succeed | ||
231 | * then we reset the scan state machine and terminate, | 231 | * then we reset the scan state machine and terminate, |
232 | * re-queuing another scan if one has been requested */ | 232 | * re-queuing another scan if one has been requested |
233 | if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { | 233 | */ |
234 | if (test_and_clear_bit(STATUS_SCAN_ABORTING, &priv->status)) | ||
234 | IWL_DEBUG_INFO(priv, "Aborted scan completed.\n"); | 235 | IWL_DEBUG_INFO(priv, "Aborted scan completed.\n"); |
235 | clear_bit(STATUS_SCAN_ABORTING, &priv->status); | ||
236 | } | ||
237 | 236 | ||
238 | if (!priv->is_internal_short_scan) | 237 | if (!priv->is_internal_short_scan) |
239 | priv->next_scan_jiffies = 0; | 238 | priv->next_scan_jiffies = 0; |