]> Pileus Git - ~andy/linux/commitdiff
ath9k: remove driver ASSERT, just use BUG_ON()
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 14 Sep 2009 06:28:00 +0000 (23:28 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Oct 2009 20:39:30 +0000 (16:39 -0400)
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ath9k.h
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/main.c
drivers/net/wireless/ath/ath9k/rc.c
drivers/net/wireless/ath/ath9k/recv.c
drivers/net/wireless/ath/ath9k/xmit.c

index f3b5a609554ec07ecdaf1e21c0e7494d1e8ba76f..e512d519c5962fe617a984c6b3b92f8c4db15295 100644 (file)
@@ -54,8 +54,6 @@ struct ath_node;
 
 #define A_MAX(a, b) ((a) > (b) ? (a) : (b))
 
-#define ASSERT(exp) BUG_ON(!(exp))
-
 #define TSF_TO_TU(_h,_l) \
        ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
 
index 9d03d27a7dcb950bc9b1272acf09bcf890db77bc..93da19cbff1033c19b19730dace8d432370daf86 100644 (file)
@@ -3814,7 +3814,7 @@ void ath9k_hw_cfg_gpio_input(struct ath_hw *ah, u32 gpio)
 {
        u32 gpio_shift;
 
-       ASSERT(gpio < ah->caps.num_gpio_pins);
+       BUG_ON(gpio >= ah->caps.num_gpio_pins);
 
        gpio_shift = gpio << 1;
 
index e9aac3cbd4de0994cf0db03074523f2fe0b711e6..0d8977341b2c18e2130ea10dc5b60a704decabd1 100644 (file)
@@ -2030,7 +2030,7 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
        if ((sizeof(struct ath_desc) % 4) != 0) {
                ath_print(common, ATH_DBG_FATAL,
                          "ath_desc not DWORD aligned\n");
-               ASSERT((sizeof(struct ath_desc) % 4) == 0);
+               BUG_ON((sizeof(struct ath_desc) % 4) != 0);
                error = -ENOMEM;
                goto fail;
        }
@@ -2088,7 +2088,7 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,
                         * descriptor fetch.
                         */
                        while (ATH_DESC_4KB_BOUND_CHECK(bf->bf_daddr)) {
-                               ASSERT((caddr_t) bf->bf_desc <
+                               BUG_ON((caddr_t) bf->bf_desc >=
                                       ((caddr_t) dd->dd_desc +
                                        dd->dd_desc_len));
 
index 7346649af2d7696357601d0bf1a62fa7a1a06019..063936423d86f35065006245dc289d372e29b95e 100644 (file)
@@ -425,7 +425,7 @@ static void ath_rc_init_valid_txmask(struct ath_rate_priv *ath_rc_priv)
 static inline void ath_rc_set_valid_txmask(struct ath_rate_priv *ath_rc_priv,
                                           u8 index, int valid_tx_rate)
 {
-       ASSERT(index <= ath_rc_priv->rate_table_size);
+       BUG_ON(index > ath_rc_priv->rate_table_size);
        ath_rc_priv->valid_rate_index[index] = valid_tx_rate ? 1 : 0;
 }
 
@@ -1243,7 +1243,7 @@ static void ath_rc_init(struct ath_softc *sc,
 
        ath_rc_priv->rate_table_size = hi + 1;
        ath_rc_priv->rate_max_phy = 0;
-       ASSERT(ath_rc_priv->rate_table_size <= RATE_TABLE_SIZE);
+       BUG_ON(ath_rc_priv->rate_table_size > RATE_TABLE_SIZE);
 
        for (i = 0, k = 0; i < WLAN_RC_PHY_MAX; i++) {
                for (j = 0; j < ath_rc_priv->valid_phy_ratecnt[i]; j++) {
@@ -1257,8 +1257,8 @@ static void ath_rc_init(struct ath_softc *sc,
 
                ath_rc_priv->rate_max_phy = ath_rc_priv->valid_phy_rateidx[i][j-1];
        }
-       ASSERT(ath_rc_priv->rate_table_size <= RATE_TABLE_SIZE);
-       ASSERT(k <= RATE_TABLE_SIZE);
+       BUG_ON(ath_rc_priv->rate_table_size > RATE_TABLE_SIZE);
+       BUG_ON(k > RATE_TABLE_SIZE);
 
        ath_rc_priv->max_valid_rate = k;
        ath_rc_sort_validrates(rate_table, ath_rc_priv);
index 6caef1b5dfe240bdc76ec03b2d616590ca7d70df..3a2204d847022571e8c8cf1b21b9ec18463d90fe 100644 (file)
@@ -59,7 +59,7 @@ static void ath_rx_buf_link(struct ath_softc *sc, struct ath_buf *bf)
 
        /* virtual addr of the beginning of the buffer. */
        skb = bf->bf_mpdu;
-       ASSERT(skb != NULL);
+       BUG_ON(skb == NULL);
        ds->ds_vdata = skb->data;
 
        /* setup rx descriptors. The rx.bufsize here tells the harware
index f302652af396805dd46f28df2c9bef9761f5a167..a8620b1d091ba6a134f08e475bc74498db9f490f 100644 (file)
@@ -107,7 +107,7 @@ static void ath_tx_resume_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
 {
        struct ath_txq *txq = &sc->tx.txq[tid->ac->qnum];
 
-       ASSERT(tid->paused > 0);
+       BUG_ON(tid->paused <= 0);
        spin_lock_bh(&txq->axq_lock);
 
        tid->paused--;
@@ -131,7 +131,7 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
        struct list_head bf_head;
        INIT_LIST_HEAD(&bf_head);
 
-       ASSERT(tid->paused > 0);
+       BUG_ON(tid->paused <= 0);
        spin_lock_bh(&txq->axq_lock);
 
        tid->paused--;
@@ -143,7 +143,7 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
 
        while (!list_empty(&tid->buf_q)) {
                bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
-               ASSERT(!bf_isretried(bf));
+               BUG_ON(bf_isretried(bf));
                list_move_tail(&bf->list, &bf_head);
                ath_tx_send_ht_normal(sc, txq, tid, &bf_head);
        }
@@ -178,7 +178,7 @@ static void ath_tx_addto_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
        index  = ATH_BA_INDEX(tid->seq_start, bf->bf_seqno);
        cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
 
-       ASSERT(tid->tx_buf[cindex] == NULL);
+       BUG_ON(tid->tx_buf[cindex] != NULL);
        tid->tx_buf[cindex] = bf;
 
        if (index >= ((tid->baw_tail - tid->baw_head) &
@@ -358,7 +358,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
                        else
                                INIT_LIST_HEAD(&bf_head);
                } else {
-                       ASSERT(!list_empty(bf_q));
+                       BUG_ON(list_empty(bf_q));
                        list_move_tail(&bf->list, &bf_head);
                }
 
@@ -946,7 +946,7 @@ int ath_txq_update(struct ath_softc *sc, int qnum,
                return 0;
        }
 
-       ASSERT(sc->tx.txq[qnum].axq_qnum == qnum);
+       BUG_ON(sc->tx.txq[qnum].axq_qnum != qnum);
 
        ath9k_hw_get_txq_props(ah, qnum, &qi);
        qi.tqi_aifs = qinfo->tqi_aifs;