From mboxrd@z Thu Jan 1 00:00:00 1970 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 F14F5C43457 for ; Mon, 19 Oct 2020 10:18:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C11222263 for ; Mon, 19 Oct 2020 10:18:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Ay5afY3n"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Bwy/LQ9S" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729340AbgJSKSU (ORCPT ); Mon, 19 Oct 2020 06:18:20 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:58742 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729182AbgJSKSL (ORCPT ); Mon, 19 Oct 2020 06:18:11 -0400 Message-Id: <20201019101110.240285929@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603102689; 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=WngfxKCbiTKE9erlSaLbB4MmoQbLDSkUgvyXSrV+/VI=; b=Ay5afY3nWqWdPkkzJsp41vh5O+dD2nd/0fG7RPbP5DUH92jHLqP6Kx+3E+AHYac364F9Mo A2bpcoj3jwogNqL3dtlf2Szc3PgPAu6ewzrYCOYGLMss1il8aDMVLdwRhDvVduzPmijOUx bYyr58hIlLaMiCjqfoG7PA5U4avgF10+lL9DkkA4pBxuqxXEV++cJrBhuREFpO56yA46XI qaOv8WbByE5HGmV28mYtJpVk4afPWMXE2eXAgiOo7srHiNb4bX+BPVXnlTTKFTEJUEynxY NEMYP+tMNTl6fRPX9Y3Stq50xgCoi3m8zzsXrAgZ8gDIX2ivJINECVsfzcWlQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603102689; 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=WngfxKCbiTKE9erlSaLbB4MmoQbLDSkUgvyXSrV+/VI=; b=Bwy/LQ9S8g8N8l1iMRJCmuGn0XWiNGgBFATYWG6atDTGprcVSeTwnDFRmVJvB4kb9scCZ5 j72sHwPUxaQxxvAw== Date: Mon, 19 Oct 2020 12:06:35 +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 V2 06/13] usb: host: isp1362: Replace in_interrupt() usage References: <20201019100629.419020859@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 --- V2: Fix silly typo --- 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_hcd, 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 From mboxrd@z Thu Jan 1 00:00:00 1970 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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 77616C433E7 for ; Mon, 19 Oct 2020 10:21:15 +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 02AE822276 for ; Mon, 19 Oct 2020 10:21:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="H5BKIsPN"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Ay5afY3n"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Bwy/LQ9S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02AE822276 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+linux-arm-kernel=archiver.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=Rz1SP3p6tXMeZuHU3WqqtGS6NQYzz+a76tRh0FFMj7Y=; b=H5BKIsPNudrPGQpRitC4myfGs P9DfnKHs0l5CiH5FKYyVByZy2tdxvTbAYjed0H0nlx8A18ZF+ZXbm45IDp9pKfNvQaGdl7mHxWyE5 4lVod4xQPVMVBmcMo/6vjDVqJ91IgRzQB5cDzOzUyZ/wmtmn0DHcoTJ4r2tuUVm20dtRZgPpyktK4 qR4HBxbVyzUxH47gkzn48xSHma1JchCCrDcTI/R2LpvjxNqQjXNj/I8iNP1rNBiA3BxOfmKI2hEbt YLeh2nY+AhNS3aSvLCDbHYRJMGWdu9eZL7/m3P00cqDYbJS3N1XmsNgcdWF7oveB8UZfLbAYvzSv1 xNCDXPLvA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kUSG2-0003DH-Ub; Mon, 19 Oct 2020 10:19:15 +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 1kUSF0-0002qo-Cy for linux-arm-kernel@lists.infradead.org; Mon, 19 Oct 2020 10:18:13 +0000 Message-Id: <20201019101110.240285929@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603102689; 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=WngfxKCbiTKE9erlSaLbB4MmoQbLDSkUgvyXSrV+/VI=; b=Ay5afY3nWqWdPkkzJsp41vh5O+dD2nd/0fG7RPbP5DUH92jHLqP6Kx+3E+AHYac364F9Mo A2bpcoj3jwogNqL3dtlf2Szc3PgPAu6ewzrYCOYGLMss1il8aDMVLdwRhDvVduzPmijOUx bYyr58hIlLaMiCjqfoG7PA5U4avgF10+lL9DkkA4pBxuqxXEV++cJrBhuREFpO56yA46XI qaOv8WbByE5HGmV28mYtJpVk4afPWMXE2eXAgiOo7srHiNb4bX+BPVXnlTTKFTEJUEynxY NEMYP+tMNTl6fRPX9Y3Stq50xgCoi3m8zzsXrAgZ8gDIX2ivJINECVsfzcWlQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603102689; 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=WngfxKCbiTKE9erlSaLbB4MmoQbLDSkUgvyXSrV+/VI=; b=Bwy/LQ9S8g8N8l1iMRJCmuGn0XWiNGgBFATYWG6atDTGprcVSeTwnDFRmVJvB4kb9scCZ5 j72sHwPUxaQxxvAw== Date: Mon, 19 Oct 2020 12:06:35 +0200 From: Thomas Gleixner To: LKML Subject: [patch V2 06/13] usb: host: isp1362: Replace in_interrupt() usage References: <20201019100629.419020859@linutronix.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201019_061810_616145_B47ACE8D X-CRM114-Status: GOOD ( 12.84 ) 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.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 --- V2: Fix silly typo --- 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_hcd, 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel