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: 269853 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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 6F2B9C43457 for ; Wed, 14 Oct 2020 15:19:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 175522222A for ; Wed, 14 Oct 2020 15:19:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (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" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389085AbgJNPTa (ORCPT ); Wed, 14 Oct 2020 11:19:30 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:59078 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731769AbgJNPS4 (ORCPT ); Wed, 14 Oct 2020 11:18:56 -0400 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 Cc: Peter Zijlstra , "Ahmed S. Darwish" , Sebastian Andrzej Siewior , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Thomas Winischhofer , Johan Hovold , 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 06/12] usb: host: isp1362: Replace in_interrupt() usage References: <20201014145215.518912759@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.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 Reported-by: kernel test robot --- 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