* @trans: transport pointer (for configuration)
  * @rxq: the rxq to get the rb stts from
  */
-static inline __le16 iwl_get_closed_rb_stts(struct iwl_trans *trans,
-                                           struct iwl_rxq *rxq)
+static inline u16 iwl_get_closed_rb_stts(struct iwl_trans *trans,
+                                        struct iwl_rxq *rxq)
 {
        if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) {
                __le16 *rb_stts = rxq->rb_stts;
 
-               return READ_ONCE(*rb_stts);
+               return le16_to_cpu(READ_ONCE(*rb_stts));
        } else {
                struct iwl_rb_status *rb_stts = rxq->rb_stts;
 
-               return READ_ONCE(rb_stts->closed_rb_num);
+               return le16_to_cpu(READ_ONCE(rb_stts->closed_rb_num)) & 0xFFF;
        }
 }
 
 
        spin_lock(&rxq->lock);
        /* uCode's read index (stored in shared DRAM) indicates the last Rx
         * buffer that the driver may process (last buffer filled by ucode). */
-       r = le16_to_cpu(iwl_get_closed_rb_stts(trans, rxq)) & 0x0FFF;
+       r = iwl_get_closed_rb_stts(trans, rxq);
        i = rxq->read;
 
        /* W/A 9000 device step A0 wrap-around bug */
 
                pos += scnprintf(buf + pos, bufsz - pos, "\tfree_count: %u\n",
                                 rxq->free_count);
                if (rxq->rb_stts) {
-                       u32 r = __le16_to_cpu(iwl_get_closed_rb_stts(trans,
-                                                                    rxq));
+                       u32 r = iwl_get_closed_rb_stts(trans, rxq);
                        pos += scnprintf(buf + pos, bufsz - pos,
-                                        "\tclosed_rb_num: %u\n",
-                                        r & 0x0FFF);
+                                        "\tclosed_rb_num: %u\n", r);
                } else {
                        pos += scnprintf(buf + pos, bufsz - pos,
                                         "\tclosed_rb_num: Not Allocated\n");
 
        spin_lock(&rxq->lock);
 
-       r = le16_to_cpu(iwl_get_closed_rb_stts(trans, rxq)) & 0x0FFF;
+       r = iwl_get_closed_rb_stts(trans, rxq);
 
        for (i = rxq->read, j = 0;
             i != r && j < allocated_rb_nums;
                /* Dump RBs is supported only for pre-9000 devices (1 queue) */
                struct iwl_rxq *rxq = &trans_pcie->rxq[0];
                /* RBs */
-               num_rbs =
-                       le16_to_cpu(iwl_get_closed_rb_stts(trans, rxq))
-                       & 0x0FFF;
+               num_rbs = iwl_get_closed_rb_stts(trans, rxq);
                num_rbs = (num_rbs - rxq->read) & RX_QUEUE_MASK;
                len += num_rbs * (sizeof(*data) +
                                  sizeof(struct iwl_fw_error_dump_rb) +