Linux-MIPS Archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: linux-kernel@vger.kernel.org
Cc: "Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	linux-mips@vger.kernel.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Yury Norov" <yury.norov@gmail.com>
Subject: [PATCH] MIPS: SGI-IP30: Use bitmap API when iterating over bitmap
Date: Wed, 17 Apr 2024 09:18:29 +0200	[thread overview]
Message-ID: <20240417071830.47703-1-philmd@linaro.org> (raw)

Do not open-code bitmap_set(). Besides, <linux/bitmap.h> API
allows architecture specific optimizations, so prefer it.

Use the HEART_NUM_IRQS definition to express the end of the
HEART bitmap.

Inspired-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 arch/mips/sgi-ip30/ip30-irq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/mips/sgi-ip30/ip30-irq.c b/arch/mips/sgi-ip30/ip30-irq.c
index 423c32cb66ed..bdafff076191 100644
--- a/arch/mips/sgi-ip30/ip30-irq.c
+++ b/arch/mips/sgi-ip30/ip30-irq.c
@@ -264,7 +264,6 @@ void __init arch_init_irq(void)
 	struct irq_domain *domain;
 	struct fwnode_handle *fn;
 	unsigned long *mask;
-	int i;
 
 	mips_cpu_irq_init();
 
@@ -300,8 +299,7 @@ void __init arch_init_irq(void)
 	set_bit(HEART_L3_INT_TIMER, heart_irq_map);
 
 	/* Reserve the error interrupts (#51 to #63). */
-	for (i = HEART_L4_INT_XWID_ERR_9; i <= HEART_L4_INT_HEART_EXCP; i++)
-		set_bit(i, heart_irq_map);
+	bitmap_set(heart_irq_map, HEART_L4_INT_XWID_ERR_9, HEART_NUM_IRQS);
 
 	fn = irq_domain_alloc_named_fwnode("HEART");
 	WARN_ON(fn == NULL);
-- 
2.41.0


             reply	other threads:[~2024-04-17  7:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17  7:18 Philippe Mathieu-Daudé [this message]
2024-04-17 11:13 ` [PATCH] MIPS: SGI-IP30: Use bitmap API when iterating over bitmap Thomas Bogendoerfer
2024-04-17 17:27 ` Yury Norov
2024-04-18 13:37   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240417071830.47703-1-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).