[patch 0/4] media: Cleanup in_interrupt() usage

From: Thomas Gleixner
Date: Tue Oct 13 2020 - 10:39:26 EST


Folks,

in the discussion about preempt count consistency accross kernel
configurations:

https://lore.kernel.org/r/20200914204209.256266093@xxxxxxxxxxxxx/

it was concluded that the usage of in_interrupt() and related context
checks should be removed from non-core code.

The media subsystem has a few instances of in_interrupt() usage:

1) BUG_ON(in_interrupt()

BUG_ON() is considered the last resort and the usage there is clearly
not in that category. It could be replaced by a
lockdep_assert_preemption_enabled(), but all these usage sites invoke
core functionality which will catch incorrect context already. So
adding more there is not really useful

2) Comments and printk()'s

The comment is misleading and the checks in the printk()'s are
pointless as the code can never be called from in_interrupt() as it
contains GFP_KERNEL allocations.

I'm collecting related cleanups all over the tree, but feel free to route
them through the media tree as they have no dependencies. Let me know which
route you prefer.

Thanks,

tglx
---
common/saa7146/saa7146_fops.c | 2 --
pci/bt8xx/bttv-risc.c | 1 -
pci/cx23885/cx23885-core.c | 1 -
pci/cx25821/cx25821-core.c | 1 -
platform/fsl-viu.c | 2 --
platform/omap3isp/ispccdc.c | 5 ++---
usb/au0828/au0828-video.c | 5 ++---
usb/cx231xx/cx231xx-core.c | 10 ++++------
usb/cx231xx/cx231xx-vbi.c | 3 +--
usb/tm6000/tm6000-video.c | 2 --
usb/zr364xx/zr364xx.c | 2 --
11 files changed, 9 insertions(+), 25 deletions(-)