From patchwork Mon Jul 8 15:17:55 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: 13726714 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 65298C3DA42 for ; Mon, 8 Jul 2024 15:19: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=bAytSnSCOp+iDQG5LQPnZfX4LI4TX8F70H4eYyp/ZOc=; b=nLcKU7l2wWYDqU5Df751sLeKFS NO/rYu8YhR9uj7YnbLAv+Um6+eN73VW+3ixHbhioIZBHvZd5qD1dQZI0KigolO0WtGzCL9cArhqdr IZqNqIC8yoTEOb/AzbdwuBkOnDzbdd+L5WWQpUHSC+fvknOl4Nqs6AjIBwF1G8giOWnnm49Iy+dfx d8UtFl+7tLXthTt46ldHJOU1F59YyWa9HYVRltIsb1U1jbvyqNLMQGWjrfQ0vzwrwf+n97dO091GN IHBQH97uSWFTqwnJ3fqGPP2G9kQMS6yFq20tggN8lm4BBVY/IE/0UoBY5GlxVlA+5VH/AZqWJiV9m fVAnc1MQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQq96-00000004Bcy-2epF; Mon, 08 Jul 2024 15:19:16 +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 1sQq8B-00000004BKi-02XS for linux-arm-kernel@lists.infradead.org; Mon, 08 Jul 2024 15:18:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0604460E9F; Mon, 8 Jul 2024 15:18:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A198C116B1; Mon, 8 Jul 2024 15:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720451897; bh=cWZbLIuojFCoXnB9aGBVY44haKGjY6v2ZOgc9cohXRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gxi92MRjGzfJ0rsapP5RVhiko4AQIRz8eE0IBnvJ6fzvkAoD4p32jsfXjv8cD5OQk EPJxsQHRwtzEco20KlHZG/hkwESyamScF8mQGTCKmXzDiHzS1eDoAyK+uRNWd38h9i NpUuARYcER4rhVXk7TB3fEwXEbwcrsS0/6yyHHI8yukL2EHAAp+mDddwb3IxKVasya tRhsoaZ4c53sIJcQ/DycI1BnpgliIbrN1hXaijx2/wbY48Hxz/Z1uLiVkHEnzjpbJa q23Hyv1ZF4gU11nG/eODs67ZWJsiD10uc2FiwhGPIBr0QJ39ezXshaBvDNn1zT60QO Iy6HSFXsjGpTQ== 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 v3 04/10] irqchip/armada-370-xp: Use BIT() and GENMASK() macros Date: Mon, 8 Jul 2024 17:17:55 +0200 Message-ID: <20240708151801.11592-5-kabel@kernel.org> X-Mailer: git-send-email 2.44.2 In-Reply-To: <20240708151801.11592-1-kabel@kernel.org> References: <20240708151801.11592-1-kabel@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240708_081819_116517_0976318E X-CRM114-Status: GOOD ( 12.42 ) 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 Use the BIT() and GENMASK() macros where appropriate. Signed-off-by: Marek BehĂșn Reviewed-by: Andrew Lunn --- drivers/irqchip/irq-armada-370-xp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 427ba5fd6adc..18aca9b5d3b3 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c @@ -121,7 +121,7 @@ #define ARMADA_370_XP_INT_SET_ENABLE (0x30) #define ARMADA_370_XP_INT_CLEAR_ENABLE (0x34) #define ARMADA_370_XP_INT_SOURCE_CTL(irq) (0x100 + irq*4) -#define ARMADA_370_XP_INT_SOURCE_CPU_MASK 0xF +#define ARMADA_370_XP_INT_SOURCE_CPU_MASK GENMASK(3, 0) #define ARMADA_370_XP_INT_IRQ_FIQ_MASK(cpuid) ((BIT(0) | BIT(8)) << cpuid) /* Registers relative to per_cpu_int_base */ @@ -132,18 +132,18 @@ #define ARMADA_370_XP_INT_SET_MASK (0x48) #define ARMADA_370_XP_INT_CLEAR_MASK (0x4C) #define ARMADA_370_XP_INT_FABRIC_MASK (0x54) -#define ARMADA_370_XP_INT_CAUSE_PERF(cpu) (1 << cpu) +#define ARMADA_370_XP_INT_CAUSE_PERF(cpu) BIT(cpu) #define ARMADA_370_XP_MAX_PER_CPU_IRQS (28) /* IPI and MSI interrupt definitions for IPI platforms */ #define IPI_DOORBELL_START (0) #define IPI_DOORBELL_END (8) -#define IPI_DOORBELL_MASK 0xFF +#define IPI_DOORBELL_MASK GENMASK(7, 0) #define PCI_MSI_DOORBELL_START (16) #define PCI_MSI_DOORBELL_NR (16) #define PCI_MSI_DOORBELL_END (32) -#define PCI_MSI_DOORBELL_MASK 0xFFFF0000 +#define PCI_MSI_DOORBELL_MASK GENMASK(31, 16) /* MSI interrupt definitions for non-IPI platforms */ #define PCI_MSI_FULL_DOORBELL_START 0 @@ -415,7 +415,7 @@ static void armada_370_xp_ipi_send_mask(struct irq_data *d, /* Convert our logical CPU mask into a physical one. */ for_each_cpu(cpu, mask) - map |= 1 << cpu_logical_map(cpu); + map |= BIT(cpu_logical_map(cpu)); /* * Ensure that stores to Normal memory are visible to the