From patchwork Thu Jul 11 16:09:01 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: 13730841 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 ECCA7C3DA45 for ; Thu, 11 Jul 2024 16:10:53 +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=bqAZxNXyjjqzXcxX1caplPNPiN lCS0AJlNMCPRfgkYknynWQNA2K6QyZhH4ch50yp/BwKz2fXscFh1b6a1SeC8KX2mhk5G+fqmrgdMR rQKX1ADwFpxEn2SzQ/umqShGUzq4r+zCfPY3i8gAAet7suKb6m/ORfx+RwpgjJW5AkIZKgb3H6XTc Kjvda2/ZwrTzpAnZYVLnCUERHlD8TgyxCPBk7LEantmbeRm4hXHhneQd50yEORIXdW8gmvnz4QODY iQxbUcFCzk1Ylhju3pthg1T9Xglgeltf35P5lKvTYvjENYMb0iwQT793N5E562kFxFiiglIT5opIa mQEFiQcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwNP-0000000EdDD-3sbt; Thu, 11 Jul 2024 16:10:35 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRwMH-0000000Ecfy-1eE7 for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 16:09:26 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id B9F19CE1927; Thu, 11 Jul 2024 16:09:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA398C4AF0B; Thu, 11 Jul 2024 16:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720714162; bh=gu20sIw0sAsumDGSOtVxTeoFhNXSvRH1Qmhre3Zy49E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u6n10tOcVy7iyyDaSrQhH11Q0ZWMCtByWMNqGbxEWsu1/iQy2l0DDy4moHWpDXy93 Xoz+lSrkNp1WSEXmbGe3d1MpVD9ptRL7GqIIYtTSULQ2FQsfcWgHdrsOq9RALcQBU5 sxTFQYrvYgUlcriOfElLqvbv5bve3vcy6ALXcYyWu9sSnYyLRnCbZbcjkz1cIvrDMa Wegs62WTkl5KXkhwOe7HxmlokyClVoC1QFBfhW60EdYQGF/vaJATvR1wR5cWrwMz9z UnHxats/TMLQ2kI67y+K0W7+sKyrVkDcsdUtujoOD/giWssXq8XNlh3yisDYMDRJVS MBkd0v1hQU4lw== 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 04/10] irqchip/armada-370-xp: Simplify mpic_reenable_percpu() and mpic_resume() Date: Thu, 11 Jul 2024 18:09:01 +0200 Message-ID: <20240711160907.31012-5-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711160907.31012-1-kabel@kernel.org> References: <20240711160907.31012-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240711_090925_656931_BEE36530 X-CRM114-Status: GOOD ( 11.71 ) 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;