From patchwork Tue Jul 2 11:42:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 13719502 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86E36C3064D for ; Tue, 2 Jul 2024 11:47:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jA4Lorces5G5tvjcmQFJi1TQJkjONPBEqOMcqE4BIm0=; b=PLzjgSWUtB6MgUEY4UXcK7yCDp /8iGg6Otv/7X02i80EjoRfIdd2l6DqcB53DWySg4wbNKo1jXkGowaXMDzlDpSHw7AV/Qeut5r6OaT 9j8XlaDnlAyFGSXMGA+KpreAtq/FX8pnJ9XB+kuZlu+TRICO15XstELkTgD7dar7Ch+SsOSHyWYKN GcwH4PaGZsLQ3wMa1LMEkOF+ANwRaE5mYoDUcBfxlbf97NpSkr1fhp1z8L6lH28axzh7BsQAqWIGF 7tD2OYCSXq2sOwBrb6QuXHqZFdvaMsL0ZgTPGv2K16Qa5flXktHG6hykhPqoO/ksrx0h1rUGDbCCg 81js938g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sObyg-00000006Y8U-3joP; Tue, 02 Jul 2024 11:47:18 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sObvf-00000006WVF-2FNw for linux-arm-kernel@lists.infradead.org; Tue, 02 Jul 2024 11:44:12 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E02446190D; Tue, 2 Jul 2024 11:44:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73963C32781; Tue, 2 Jul 2024 11:44:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719920650; bh=gu20sIw0sAsumDGSOtVxTeoFhNXSvRH1Qmhre3Zy49E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HSWnUdbv5lv52g2GXK0M8A+Rtql3GQQZEyGccEcbA25bKfLP3FrYfgGoycygOAgl8 w3X76TtufzHulqX9Vuv95pE+QF/G3iAZmCsx3mjCLJZB1/B7DB9exlEvYBgj0VCaZ5 SMoaPz6vYBqG15XS2LrWY0r+ornmMQ667MUks60DGlKsEJcjf+sYo2sVJdS54K0K19 PscumS/Bi6wyHBEbt5GwRAZxG6Sq10IYxN2Nn886QcTbrVMvI9lN3N5fT5v9hmkGaN dDgVGRo0RzWFzLGIyy7Qnv9Tu1fUKwOf+2mX6bT5weIg6TuszeTeYhiIZENbrzPVV6 KZDB0q+RgwWcg== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, arm@kernel.org, Andy Shevchenko , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH v2 24/30] irqchip/armada-370-xp: Simplify mpic_reenable_percpu() and mpic_resume() Date: Tue, 2 Jul 2024 13:42:56 +0200 Message-ID: <20240702114302.22475-25-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240702114302.22475-1-kabel@kernel.org> References: <20240702114302.22475-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240702_044411_637233_FCA1034B X-CRM114-Status: GOOD ( 12.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Refactor the mpic_reenable_percpu() and mpic_resume() functions to make them a little bit simpler. Signed-off-by: Marek BehĂșn --- drivers/irqchip/irq-armada-370-xp.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 9e4fc91fe422..3fc669cfd494 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -531,18 +531,13 @@ static void mpic_reenable_percpu(void) { /* Re-enable per-CPU interrupts that were enabled before suspend */ for (irq_hw_number_t i = 0; i < MPIC_MAX_PER_CPU_IRQS; i++) { + unsigned int virq = irq_linear_revmap(mpic_domain, i); struct irq_data *d; - unsigned int virq; - virq = irq_linear_revmap(mpic_domain, i); - if (!virq) + if (!virq || !irq_percpu_is_enabled(virq)) continue; d = irq_get_irq_data(virq); - - if (!irq_percpu_is_enabled(virq)) - continue; - mpic_irq_unmask(d); } @@ -722,10 +717,9 @@ static void mpic_resume(void) /* Re-enable interrupts */ for (irq_hw_number_t i = 0; i < mpic_domain->hwirq_max; i++) { + unsigned int virq = irq_linear_revmap(mpic_domain, i); struct irq_data *d; - unsigned int virq; - virq = irq_linear_revmap(mpic_domain, i); if (!virq) continue;