Skip to content
Permalink
Browse files
usb: host: isp1362: Replace in_interrupt() usage
isp1362_show_regs() is a debugging-only function, with no call sites. It
prints the cached value of the HCuPINTENB register if in_interupt() is
true, otherwise it reads the actual register content.

The usage of in_interrupt() in drivers is phased out and Linus clearly
requested that code which changes behaviour depending on context should
either be separated or the context be conveyed in an argument passed by the
caller, which usually knows the context.

Make the conditional based on a function argument.

Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
  • Loading branch information
Thomas Gleixner authored and intel-lab-lkp committed Oct 14, 2020
1 parent be5feda commit ee4d0a1f1ad7068ce381fd87cac015b76b77de60
Showing 1 changed file with 3 additions and 2 deletions.
@@ -793,7 +793,8 @@ static void isp1362_write_fifo(struct isp1362_hcd *isp1362_hcd, void *buf, u16 l
ISP1362_REG_NO(ISP1362_REG_##r), isp1362_read_reg16(d, r)); \
}

static void __attribute__((__unused__)) isp1362_show_regs(struct isp1362_hcd *isp1362_hcd)
static void __attribute__((__unused__))
isp1362_show_regs(struct isp1362_hcd *isp1362_hc, bool cached_inten)
{
isp1362_show_reg(isp1362_hcd, HCREVISION);
isp1362_show_reg(isp1362_hcd, HCCONTROL);
@@ -815,7 +816,7 @@ static void __attribute__((__unused__)) isp1362_show_regs(struct isp1362_hcd *is
isp1362_show_reg(isp1362_hcd, HCXFERCTR);
isp1362_show_reg(isp1362_hcd, HCuPINT);

if (in_interrupt())
if (cached_inten)
DBG(0, "%-12s[%02x]: %04x\n", "HCuPINTENB",
ISP1362_REG_NO(ISP1362_REG_HCuPINTENB), isp1362_hcd->irqenb);
else

0 comments on commit ee4d0a1

Please sign in to comment.