Thread (27 messages) 27 messages, 6 authors, 2020-10-28
STALE2064d LANDED

[PATCH v3 04/13 ] USB: serial: digi_acceleport: Remove in_interrupt() usage

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: 2020-10-26 14:03:21
Also in: linux-omap, linux-samsung-soc, linux-usb, lkml
Subsystem: the rest, usb serial subsystem, usb subsystem · Maintainers: Linus Torvalds, Johan Hovold, Greg Kroah-Hartman

From: "Ahmed S. Darwish" <redacted>

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.

The debug printk() in digi_write() prints in_interrupt() as context
information. This information is imprecisely as it does not distinguish
between hard-IRQ or disabled botton half and it does consider disabled
interrupts or preemption. It is not really helpful.

Remove the in_interrupt() printout.

Signed-off-by: Ahmed S. Darwish <redacted>
Signed-off-by: Thomas Gleixner <redacted>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Johan Hovold <johan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
---
v2…v3:
  - Don't make dev_dbg() conditional on `tty'
  - Remove the part "tty happens always in process context" from the
    commit message. Johan pointed out that for PPP it may happen in
    bottom half.

 drivers/usb/serial/digi_acceleport.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index 91055a191995f..016e7dec31962 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -911,9 +911,8 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
 	unsigned char *data = port->write_urb->transfer_buffer;
 	unsigned long flags = 0;
 
-	dev_dbg(&port->dev,
-		"digi_write: TOP: port=%d, count=%d, in_interrupt=%ld\n",
-		priv->dp_port_num, count, in_interrupt());
+	dev_dbg(&port->dev, "digi_write: TOP: port=%d, count=%d\n",
+		priv->dp_port_num, count);
 
 	/* copy user data (which can sleep) before getting spin lock */
 	count = min(count, port->bulk_out_size-2);
-- 
2.28.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help