[PATCH] vtd: Inline redundant nr_ioapic_entries macro

Teddy Astie posted 1 patch 1 week, 1 day ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/f47bc8e2b6d3f28def51cc1861fda22d7658579d.1761057749.git.teddy.astie@vates.tech
xen/drivers/passthrough/vtd/intremap.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
[PATCH] vtd: Inline redundant nr_ioapic_entries macro
Posted by Teddy Astie 1 week, 1 day ago
This macro was there when ia64 was a thing, nowaday, this macro isn't meaningful
anymore and is actually a slightly disguised nr_ioapic_entries array access.

Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
---
 xen/drivers/passthrough/vtd/intremap.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 9272a25113..7726ee618a 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -31,7 +31,6 @@
 
 #include <asm/apic.h>
 #include <asm/io_apic.h>
-#define nr_ioapic_entries(i)  nr_ioapic_entries[i]
 
 /*
  * source validation type (SVT)
@@ -68,7 +67,7 @@ static int init_apic_pin_2_ir_idx(void)
 
     nr_pins = 0;
     for ( i = 0; i < nr_ioapics; i++ )
-        nr_pins += nr_ioapic_entries(i);
+        nr_pins += nr_ioapic_entries[i];
 
     _apic_pin_2_ir_idx = xmalloc_array(int, nr_pins);
     apic_pin_2_ir_idx = xmalloc_array(int *, nr_ioapics);
@@ -86,7 +85,7 @@ static int init_apic_pin_2_ir_idx(void)
     for ( i = 0; i < nr_ioapics; i++ )
     {
         apic_pin_2_ir_idx[i] = &_apic_pin_2_ir_idx[nr_pins];
-        nr_pins += nr_ioapic_entries(i);
+        nr_pins += nr_ioapic_entries[i];
     }
 
     return 0;
-- 
2.51.0



--
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech
Re: [PATCH] vtd: Inline redundant nr_ioapic_entries macro
Posted by Andrew Cooper 1 week, 1 day ago
On 21/10/2025 3:45 pm, Teddy Astie wrote:
> This macro was there when ia64 was a thing, nowaday, this macro isn't meaningful
> anymore and is actually a slightly disguised nr_ioapic_entries array access.
>
> Signed-off-by: Teddy Astie <teddy.astie@vates.tech>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Queued in my branch of trivial things for 4.22.