Skip to content

Commit

Permalink
netdev: use napi_schedule bool instead of napi_schedule_prep/__napi_s…
Browse files Browse the repository at this point in the history
…chedule

Replace if condition of napi_schedule_prep/__napi_schedule and use bool
from napi_schedule directly where possible.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://lore.kernel.org/r/20231009133754.9834-5-ansuelsmth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Christian Marangi authored and Jakub Kicinski committed Oct 12, 2023
1 parent be17623 commit d1fea38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/atheros/atlx/atl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2446,16 +2446,14 @@ static int atl1_rings_clean(struct napi_struct *napi, int budget)

static inline int atl1_sched_rings_clean(struct atl1_adapter* adapter)
{
if (!napi_schedule_prep(&adapter->napi))
if (!napi_schedule(&adapter->napi))
/* It is possible in case even the RX/TX ints are disabled via IMR
* register the ISR bits are set anyway (but do not produce IRQ).
* To handle such situation the napi functions used to check is
* something scheduled or not.
*/
return 0;

__napi_schedule(&adapter->napi);

/*
* Disable RX/TX ints via IMR register if it is
* allowed. NAPI handler must reenable them in same
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/wireless/intel/iwlwifi/pcie/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1660,9 +1660,7 @@ irqreturn_t iwl_pcie_irq_rx_msix_handler(int irq, void *dev_id)
IWL_DEBUG_ISR(trans, "[%d] Got interrupt\n", entry->entry);

local_bh_disable();
if (napi_schedule_prep(&rxq->napi))
__napi_schedule(&rxq->napi);
else
if (!napi_schedule(&rxq->napi))
iwl_pcie_clear_irq(trans, entry->entry);
local_bh_enable();

Expand Down

0 comments on commit d1fea38

Please sign in to comment.