From patchwork Mon Oct 26 14:03:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 286612 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFCA1C2D0A3 for ; Mon, 26 Oct 2020 14:03:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E9422463C for ; Mon, 26 Oct 2020 14:03:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="aEC/DFGA"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="MBgKbLCj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1780900AbgJZODS (ORCPT ); Mon, 26 Oct 2020 10:03:18 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:40242 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1780899AbgJZODS (ORCPT ); Mon, 26 Oct 2020 10:03:18 -0400 Date: Mon, 26 Oct 2020 15:03:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603720995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/XYLTnd4F+MtBkIEH9ciCsQ1o4o3fSs6saBPeUcCQRg=; b=aEC/DFGAzRNOiLoJ+IZswCQThDVstB95WznPoAR3plToyC0oKuWMntD/MsM7Q80qKg/2jO adPxZGvGg7lvDVSirCUS9D2Wta9ebe+TvRe5/DRNz1FIfM2t7IK1H5pDHy9BCMcIONVuvf hIXkpKAYZqrxK0McvVoaTZpzdMK5Xh0abpfujx6J8MPwp7QXTpLwMbLPesXEXLxSbrA1YW 1sQ3ujDlOgt1oJHCdV5ZGIrBRDEVIx3GCOuMnAivzUpwnptyXAeoUTcDm4qnFcFG15p4Ge GcW+gOXJLp4nIiVi6zivJuwi5MeCguM7AjBDbyU7GMGleDGoKn+dN6uaA4m15w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603720995; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/XYLTnd4F+MtBkIEH9ciCsQ1o4o3fSs6saBPeUcCQRg=; b=MBgKbLCjynQlRvNZZxzHBvGsL2zC0Jh0u6i5DMLd7ximjnilFbLyHFIc1rye4RBzvKe46v c744gr3dJcGlRwDg== From: Sebastian Andrzej Siewior To: Johan Hovold Cc: Thomas Gleixner , LKML , Peter Zijlstra , "Ahmed S. Darwish" , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Thomas Winischhofer , Mathias Nyman , Valentina Manea , Shuah Khan , Alan Stern , linux-omap@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Felipe Balbi , Duncan Sands Subject: [PATCH v3 04/13 ] USB: serial: digi_acceleport: Remove in_interrupt() usage Message-ID: <20201026140313.dpg3hkhkje2os4hw@linutronix.de> References: <20201019100629.419020859@linutronix.de> <20201019101110.019266389@linutronix.de> <20201025171613.GT26280@localhost> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201025171613.GT26280@localhost> Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: "Ahmed S. Darwish" 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 Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Cc: Johan Hovold Cc: Greg Kroah-Hartman 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);