From patchwork Thu Jul 11 11:57:42 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: 13730633 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 92779C3DA4A for ; Thu, 11 Jul 2024 11:59:27 +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=g5GizAVgyxmL8de/Ai1ppF7kgqOMshmJUC8PNXOrpgk=; b=kbAbSzAlZuyuxZRk4GKKtRl24d +A21/KR8Z36yDnj1ikP45reodCbj98pGGr4c3rrqw9xpLwkGqyxnTCe9ljsPSqa4ZLpvM/XDitfrH aPZTGpyK48r+rw9Zo0cDqH4mzHAbEdqaxNfnlR2w5NlN78bdxf4tsgZcPm60ch9GlM3ZIL0qH2Q+o XthfwR27BQbvqHueO1+fv189Ac8p2kIwm5g7d4XfWue3lJFjaB2QtfopD7E6+NRl4nudTXacbQlxd haOo8arBVqiHrT/OKBmqhKPkFo+yJ/1arxTHCzIbA2kvY3YaH2REAB6J6yowatfaZjIi7eIxnqHBo Pjx5CVMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRsSD-0000000DsMl-3nQT; Thu, 11 Jul 2024 11:59:17 +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 1sRsR3-0000000Drwv-2HVU for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2024 11:58:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 136A761C00; Thu, 11 Jul 2024 11:58:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9721DC4AF0C; Thu, 11 Jul 2024 11:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720699084; bh=xfdwBm73zrsE8jJbz66cyUfza8+3mTMfHMR1ZtugqdA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tr/nmBLYbBLWhU22ClAep0N/vWS/A1llOJr4+V/9krA2oaLqGF8Q2sw2We+t501T3 P6kbw9+1u2fn4JGPNbZZgFRdqJGb+ufR83py8+4+Kr2IgFt7i39r6xiuoLtYkBLS3E hMlVNJ+CCckTY3PDc/r6Z0Ma7s5R9ds/7Wo1y8DjmHRpzG0Yvq4BIoZtn+bUinety9 KYnCaJtT3XnZqv7xUo+7VYYldn/ZmugL/oPE69cvXMrMqOUQ0//9Nm6fsmueNj1LBO bthYiftRXtYpbfLwjRUl5/MOEeFzWWdWzxFqCtpUb7HNsFkZcAY+vBNcR95AVEtNOf Bwj0AnYv5a6sg== 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 ipi_resume() code Date: Thu, 11 Jul 2024 13:57:42 +0200 Message-ID: <20240711115748.30268-5-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240711115748.30268-1-kabel@kernel.org> References: <20240711115748.30268-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_045805_663422_8F3FD5A4 X-CRM114-Status: GOOD ( 11.72 ) 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 ipi_resume() function to drop one indentation level. Signed-off-by: Marek BehĂșn Reviewed-by: Andrew Lunn --- drivers/irqchip/irq-armada-370-xp.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index c007610413fe..316c27c97951 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -462,16 +462,14 @@ static const struct irq_domain_ops ipi_domain_ops = { static void ipi_resume(void) { for (int i = 0; i < IPI_DOORBELL_END; i++) { - unsigned int virq; + unsigned int virq = irq_find_mapping(ipi_domain, i); + struct irq_data *d; - virq = irq_find_mapping(ipi_domain, i); - if (!virq) + if (!virq || !irq_percpu_is_enabled(virq)) continue; - if (irq_percpu_is_enabled(virq)) { - struct irq_data *d; - d = irq_domain_get_irq_data(ipi_domain, virq); - armada_370_xp_ipi_unmask(d); - } + + d = irq_domain_get_irq_data(ipi_domain, virq); + armada_370_xp_ipi_unmask(d); } }