aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2012-11-14 16:38:08 -0500
committerJohannes Berg <johannes.berg@intel.com>2012-11-19 09:06:17 -0500
commit6ca6ebc1606c6fa7e8931445e84f21f4843e3bab (patch)
treee07c0939d8298933e04f88fb142482398c82db2c
parent686681b066fed089d14c9cee60d9d95680da6cdb (diff)
iwlwifi: make iwl_queue_used return bool
Also, prefer the if(!X) notation over if(X == 0). Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/internal.h2
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/tx.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h
index 0d61e91c0a6f..e6b6dba982c7 100644
--- a/drivers/net/wireless/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/iwlwifi/pcie/internal.h
@@ -423,7 +423,7 @@ static inline void iwl_stop_queue(struct iwl_trans *trans,
423 txq->q.id); 423 txq->q.id);
424} 424}
425 425
426static inline int iwl_queue_used(const struct iwl_queue *q, int i) 426static inline bool iwl_queue_used(const struct iwl_queue *q, int i)
427{ 427{
428 return q->write_ptr >= q->read_ptr ? 428 return q->write_ptr >= q->read_ptr ?
429 (i >= q->read_ptr && i < q->write_ptr) : 429 (i >= q->read_ptr && i < q->write_ptr) :
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c
index ba2a78c150bb..40e5a6d6e6d3 100644
--- a/drivers/net/wireless/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
@@ -918,7 +918,7 @@ void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int txq_id, int ssn,
918 * the last we will free. This one must be used */ 918 * the last we will free. This one must be used */
919 last_to_free = iwl_queue_dec_wrap(tfd_num, q->n_bd); 919 last_to_free = iwl_queue_dec_wrap(tfd_num, q->n_bd);
920 920
921 if (iwl_queue_used(q, last_to_free) == 0) { 921 if (!iwl_queue_used(q, last_to_free)) {
922 IWL_ERR(trans, 922 IWL_ERR(trans,
923 "%s: Read index for DMA queue txq id (%d), last_to_free %d is out of range [0-%d] %d %d.\n", 923 "%s: Read index for DMA queue txq id (%d), last_to_free %d is out of range [0-%d] %d %d.\n",
924 __func__, txq_id, last_to_free, q->n_bd, 924 __func__, txq_id, last_to_free, q->n_bd,
@@ -969,7 +969,7 @@ static void iwl_pcie_cmdq_reclaim(struct iwl_trans *trans, int txq_id, int idx)
969 969
970 lockdep_assert_held(&txq->lock); 970 lockdep_assert_held(&txq->lock);
971 971
972 if ((idx >= q->n_bd) || (iwl_queue_used(q, idx) == 0)) { 972 if ((idx >= q->n_bd) || (!iwl_queue_used(q, idx))) {
973 IWL_ERR(trans, 973 IWL_ERR(trans,
974 "%s: Read index for DMA queue txq id (%d), index %d is out of range [0-%d] %d %d.\n", 974 "%s: Read index for DMA queue txq id (%d), index %d is out of range [0-%d] %d %d.\n",
975 __func__, txq_id, idx, q->n_bd, 975 __func__, txq_id, idx, q->n_bd,