iwlwifi: pcie: rx: use rxq queue_size instead of constant
authorJohannes Berg <johannes.berg@intel.com>
Fri, 27 Sep 2019 09:11:20 +0000 (11:11 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Wed, 20 Nov 2019 10:28:55 +0000 (12:28 +0200)
This is a little less efficient now as it's known to be a
multiqueue device in this function, but a future patch will
have to use a variable here anyway, so use rxq->queue_size
now instead to make it clearer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/pcie/rx.c

index 7f9cc4c84c18d340d7d015d5dfdffff3bd2754b7..a4d325fcf94a6eeece8ce7afd565b2ec497df4cc 100644 (file)
@@ -322,7 +322,7 @@ static void iwl_pcie_rxmq_restock(struct iwl_trans *trans,
                WARN_ON(rxb->page_dma & DMA_BIT_MASK(12));
                /* Point to Rx buffer via next RBD in circular buffer */
                iwl_pcie_restock_bd(trans, rxq, rxb);
-               rxq->write = (rxq->write + 1) & MQ_RX_TABLE_MASK;
+               rxq->write = (rxq->write + 1) & (rxq->queue_size - 1);
                rxq->free_count--;
        }
        spin_unlock(&rxq->lock);