OSDN Git Service

net: sunbmac: Replace in_interrupt() usage
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 29 Sep 2020 20:25:26 +0000 (22:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Sep 2020 21:02:54 +0000 (14:02 -0700)
commitd08749ea3fd5a6a7713fdb4d52501e484eff29c4
treecb01c63fc4a4c757856c32689ec6ba653f4a44e4
parentcaa241f0ef88ee1c81ca9e0e7135d4241bd8dde8
net: sunbmac: Replace in_interrupt() usage

bigmac_init_rings() has an argument signaling if it is called from the
interrupt handler. This is used to decide between GFP_KERNEL and GFP_ATOMIC
for memory allocations.

But it also checks in_interrupt() to handle invocations which come from the
timer callback bigmac_timer() via bigmac_hw_init(), which is invoked with
'in_irq = 0'. While the timer callback is clearly not in hard interrupt
context it is still not sleepable context.

Rename the argument to `non_blocking' and set it to true if invoked from
the timer callback or the interrupt handler which allows to remove the
in_interrupt() check and makes the code consistent.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sun/sunbmac.c