From patchwork Mon Jul 1 17:02:35 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: 13718454 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 C2B28C2BD09 for ; Mon, 1 Jul 2024 17:04:55 +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=c48h2hy5x2oNqNOWbm05ep5K7Oc+Lq2aJ0koeutkQkQ=; b=uBOMXq19C+lRzojffAESAdeamM PQOdcvFgfPbNqfFXv5gX+CCdsWFHh5GPeiyelNb0bw7L2buHNqxSeny8ApjIOxWVjXqcXPe1YNPSf VQFyIVeJc8ipdysh5jnDcZS6JtFxxE7fmPdwUS0hYDPtwDmy+9o/swZgur24FrQktD8FsEQoGeq3A fKam2A6dCBUSr9Say/aG7vbz0JoPCqa60k1HO5HG6yrnVanXpJ24HGkk20Y1pYyMLbEWujE8aCR30 jzJ/lp46dFdxKGSni9wZ7NdLLsC92bJwYuPPJ6oaOCjyw8Fzf4JmoAQOA+VspCWC6ElpFuYc2f3QZ w24SF+VQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOKSJ-00000004E9c-2Wt8; Mon, 01 Jul 2024 17:04:43 +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 1sOKR2-00000004DV7-15v2 for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2024 17:03:25 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9F473614D1; Mon, 1 Jul 2024 17:03:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38769C116B1; Mon, 1 Jul 2024 17:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719853403; bh=ZuX8maw31AJsfmClGuxF69XP2OhdSc+tUfeiPsj8j3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ARkhC+ixsfpMCusXD7yV+Vd3qI1yz2ASdYpWJPqe6t5nzrpV3P0caKi+a0s1A7OTo I/b656SmcBdmsD7ZXVvP7+iU7bVynHS7kEka01pvWpNVowebOjHQyBVvQv/oI5wMj7 05e7av3zDWuXcR9Daeg01MbXyUhjimZnSpzy/Q5L2j5SlSulAi3gw1HqHH27euFb+Z Z/mVcQ9eqbRAez1+sXf3FpbfhFguz0J18qlUQ6Fraqo9Lywrb0KBEMgevHXuqwSH0S Y88VPImqA1+yEIlgjC7NO/vEjhydcVxcYOrsRZRUrpVDSCxo/D0enSOHgszrTuvE70 GCq6PX2VLhGEg== 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 11/25] irqchip/armada-370-xp: Simplify ipi_resume() code Date: Mon, 1 Jul 2024 19:02:35 +0200 Message-ID: <20240701170249.8128-12-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240701170249.8128-1-kabel@kernel.org> References: <20240701170249.8128-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240701_100324_376654_E6B6DCEE X-CRM114-Status: GOOD ( 12.07 ) 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 --- drivers/irqchip/irq-armada-370-xp.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 22e1a493abae..d8b0609a9160 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -462,16 +462,13 @@ static const struct irq_domain_ops ipi_domain_ops = { static void ipi_resume(void) { for (int i = 0; i < IPI_DOORBELL_END; i++) { - int irq; + unsigned int virq = irq_find_mapping(ipi_domain, i); - irq = irq_find_mapping(ipi_domain, i); - if (irq <= 0) + if (!virq || !irq_percpu_is_enabled(virq)) continue; - if (irq_percpu_is_enabled(irq)) { - struct irq_data *d; - d = irq_domain_get_irq_data(ipi_domain, irq); - armada_370_xp_ipi_unmask(d); - } + + armada_370_xp_ipi_unmask(irq_domain_get_irq_data(ipi_domain, + virq)); } }