From patchwork Wed Oct 14 14:52:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11837951 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 354DA14B2 for ; Wed, 14 Oct 2020 15:21:24 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E743E22201 for ; Wed, 14 Oct 2020 15:21:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ewTIeVx+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BCtp/tx5"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="t45kh1y2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E743E22201 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:Subject:To:From:Date: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Owner; bh=OlLRSwmYsMNzBnkrelLUbcrm/MnkwcK5l4k1Y0iC9+c=; b=ewTIeVx+Re1kabutmv51iAv+V Kv8wqXi2cKpLMY8+KX1cqzzVQluUxBT9EcKmuvs2KRjVwiJmwRETC9mcixyQeMEFbzTZ4PFyuKHYd FlPv/nsfkbMTX/CJUJeS0x0olCK766/yksMmDnCtYdmuM2Vpj0kaYBEPfGnOq9MV+64J5qKOitxb9 DCs8QT1JPM6blS/bysWl8e8T8SOLbgwPE7M3E9msFId6nCM/yjye3fEdaz3TblilKcYIJz8N6W94E Ae+43vdzpRiG3UYTI7hf2Yd1WAkbI3GyNE+HDyvXc3jWYja7kcA/EF/rpYfhdmXacF6L+1zbpe+e7 +XqmqOC4Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSiZ0-0005Dn-JS; Wed, 14 Oct 2020 15:19:38 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSiYJ-0004z7-9c for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2020 15:19:02 +0000 Message-Id: <20201014145727.716783745@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1602688734; 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: references:references; bh=YRLnsMWTgA0N3yLLMuOXyM/kVIqNO9yGhhpRz+ZaXvA=; b=BCtp/tx5doemAWLb5iC9OVRcHbnuogVy3f/vuYPOvSqNaW/X5Q8jB1qg3FoN3uM5E/58RA pqYA2gsxGvZW6sR+fr6C3qrU+H5mBKaU22Y5pbblwsaGmffC4xM5wbk49Zi8ZAkiW7t6w2 6pRMG8ROMjqjwy/hpuETtaL7VqBUJxqH+FREbAJJKb2Wp70oyk8wPRUMTVCJEd1Z1whbAa U/3Tihha60iCGN5PzVqcPm7slLAIpL7XTA0a4HSdnEuvw/IXNuMBux1s8T0reAwCF8MqeB //wT470mBRbV8K7KQVLlyvuhRNOImrVoKifY4ZgzkxPZ8J8LFQopvOlUHwf3Dg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1602688734; 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: references:references; bh=YRLnsMWTgA0N3yLLMuOXyM/kVIqNO9yGhhpRz+ZaXvA=; b=t45kh1y2+bS05Q50y7DHkmJckkmOipCBS4TBTszpC5/b/9hcirTSa2fPOgTNVkasM+lTSr 5fXbkEG1bcSBXOAA== Date: Wed, 14 Oct 2020 16:52:21 +0200 From: Thomas Gleixner To: LKML Subject: [patch 06/12] usb: host: isp1362: Replace in_interrupt() usage References: <20201014145215.518912759@linutronix.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_111855_503334_98D75E7A X-CRM114-Status: GOOD ( 12.25 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [193.142.43.55 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Felipe Balbi , Thomas Winischhofer , Mathias Nyman , Peter Zijlstra , Greg Kroah-Hartman , Sebastian Andrzej Siewior , linux-usb@vger.kernel.org, Johan Hovold , Krzysztof Kozlowski , Valentina Manea , linux-samsung-soc@vger.kernel.org, Kukjin Kim , Alan Stern , Duncan Sands , "Ahmed S. Darwish" , linux-omap@vger.kernel.org, Shuah Khan , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org --- drivers/usb/host/isp1362.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/usb/host/isp1362.h +++ b/drivers/usb/host/isp1362.h @@ -793,7 +793,8 @@ static void isp1362_write_fifo(struct is 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_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