Commit 36eed56a authored by Emmanuel Grumbach's avatar Emmanuel Grumbach Committed by Johannes Berg

iwlwifi: mvm: beautify code in rx_handlers

Make the code more readable, and while at it also
add a missing "break" to avoid checking handlers
that cannot be used.
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 7a453973
...@@ -536,25 +536,28 @@ static int iwl_mvm_rx_dispatch(struct iwl_op_mode *op_mode, ...@@ -536,25 +536,28 @@ static int iwl_mvm_rx_dispatch(struct iwl_op_mode *op_mode,
for (i = 0; i < ARRAY_SIZE(iwl_mvm_rx_handlers); i++) { for (i = 0; i < ARRAY_SIZE(iwl_mvm_rx_handlers); i++) {
const struct iwl_rx_handlers *rx_h = &iwl_mvm_rx_handlers[i]; const struct iwl_rx_handlers *rx_h = &iwl_mvm_rx_handlers[i];
if (rx_h->cmd_id == pkt->hdr.cmd) { struct iwl_async_handler_entry *entry;
struct iwl_async_handler_entry *entry;
if (!rx_h->async) if (rx_h->cmd_id != pkt->hdr.cmd)
return rx_h->fn(mvm, rxb, cmd); continue;
entry = kzalloc(sizeof(*entry), GFP_ATOMIC); if (!rx_h->async)
/* we can't do much... */ return rx_h->fn(mvm, rxb, cmd);
if (!entry)
return 0; entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
/* we can't do much... */
entry->rxb._page = rxb_steal_page(rxb); if (!entry)
entry->rxb._offset = rxb->_offset; return 0;
entry->rxb._rx_page_order = rxb->_rx_page_order;
entry->fn = rx_h->fn; entry->rxb._page = rxb_steal_page(rxb);
spin_lock(&mvm->async_handlers_lock); entry->rxb._offset = rxb->_offset;
list_add_tail(&entry->list, &mvm->async_handlers_list); entry->rxb._rx_page_order = rxb->_rx_page_order;
spin_unlock(&mvm->async_handlers_lock); entry->fn = rx_h->fn;
schedule_work(&mvm->async_handlers_wk); spin_lock(&mvm->async_handlers_lock);
} list_add_tail(&entry->list, &mvm->async_handlers_list);
spin_unlock(&mvm->async_handlers_lock);
schedule_work(&mvm->async_handlers_wk);
break;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment