diff mbox series

x86/ioapic: Fix style in io_apic.h

Message ID 20200805125124.7763-1-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show
Series x86/ioapic: Fix style in io_apic.h | expand

Commit Message

Andrew Cooper Aug. 5, 2020, 12:51 p.m. UTC
This file is a mix of Xen and Linux styles.  Switch it fully to Xen style.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/include/asm-x86/io_apic.h | 48 +++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

Comments

Jan Beulich Aug. 5, 2020, 3:08 p.m. UTC | #1
On 05.08.2020 14:51, Andrew Cooper wrote:
> This file is a mix of Xen and Linux styles.  Switch it fully to Xen style.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
with a suggestion and, I'm afraid, a few more adjustments:

> --- a/xen/include/asm-x86/io_apic.h
> +++ b/xen/include/asm-x86/io_apic.h
> @@ -13,9 +13,9 @@
>   * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar
>   */
>  
> -#define IO_APIC_BASE(idx) \
> -		((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \
> -		+ (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
> +#define IO_APIC_BASE(idx)                                               \
> +    ((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx)           \
> +                      + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))

As you touch this anyway, would you mind parenthesizing idx when
used as a, operand of + ?

> @@ -135,28 +135,28 @@ unsigned int io_apic_gsi_base(unsigned int apic);
>  
>  static inline unsigned int __io_apic_read(unsigned int apic, unsigned int reg)
>  {
> -	*IO_APIC_BASE(apic) = reg;
> -	return *(IO_APIC_BASE(apic)+4);
> +    *IO_APIC_BASE(apic) = reg;
> +    return *(IO_APIC_BASE(apic)+4);

Here and below + wants to be framed by spaces.

Jan
diff mbox series

Patch

diff --git a/xen/include/asm-x86/io_apic.h b/xen/include/asm-x86/io_apic.h
index e006b2b8dd..daf17d4c3d 100644
--- a/xen/include/asm-x86/io_apic.h
+++ b/xen/include/asm-x86/io_apic.h
@@ -13,9 +13,9 @@ 
  * Copyright (C) 1997, 1998, 1999, 2000 Ingo Molnar
  */
 
-#define IO_APIC_BASE(idx) \
-		((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \
-		+ (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
+#define IO_APIC_BASE(idx)                                               \
+    ((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx)           \
+                      + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK)))
 
 #define IO_APIC_ID(idx) (mp_ioapics[idx].mpc_apicid)
 
@@ -78,14 +78,14 @@  extern int nr_ioapics;
 extern int nr_ioapic_entries[MAX_IO_APICS];
 
 enum ioapic_irq_destination_types {
-	dest_Fixed = 0,
-	dest_LowestPrio = 1,
-	dest_SMI = 2,
-	dest__reserved_1 = 3,
-	dest_NMI = 4,
-	dest_INIT = 5,
-	dest__reserved_2 = 6,
-	dest_ExtINT = 7
+    dest_Fixed = 0,
+    dest_LowestPrio = 1,
+    dest_SMI = 2,
+    dest__reserved_1 = 3,
+    dest_NMI = 4,
+    dest_INIT = 5,
+    dest__reserved_2 = 6,
+    dest_ExtINT = 7
 };
 
 struct IO_APIC_route_entry {
@@ -135,28 +135,28 @@  unsigned int io_apic_gsi_base(unsigned int apic);
 
 static inline unsigned int __io_apic_read(unsigned int apic, unsigned int reg)
 {
-	*IO_APIC_BASE(apic) = reg;
-	return *(IO_APIC_BASE(apic)+4);
+    *IO_APIC_BASE(apic) = reg;
+    return *(IO_APIC_BASE(apic)+4);
 }
 
 static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
 {
-	if (ioapic_reg_remapped(reg))
-		return iommu_read_apic_from_ire(apic, reg);
-	return __io_apic_read(apic, reg);
+    if ( ioapic_reg_remapped(reg) )
+        return iommu_read_apic_from_ire(apic, reg);
+    return __io_apic_read(apic, reg);
 }
 
 static inline void __io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
 {
-	*IO_APIC_BASE(apic) = reg;
-	*(IO_APIC_BASE(apic)+4) = value;
+    *IO_APIC_BASE(apic) = reg;
+    *(IO_APIC_BASE(apic)+4) = value;
 }
 
 static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
 {
-	if (ioapic_reg_remapped(reg))
-		return iommu_update_ire_from_apic(apic, reg, value);
-	__io_apic_write(apic, reg, value);
+    if ( ioapic_reg_remapped(reg) )
+        return iommu_update_ire_from_apic(apic, reg, value);
+    __io_apic_write(apic, reg, value);
 }
 
 /*
@@ -165,9 +165,9 @@  static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned i
  */
 static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
 {
-	if (ioapic_reg_remapped(reg))
-		return iommu_update_ire_from_apic(apic, reg, value);
-	*(IO_APIC_BASE(apic)+4) = value;
+    if ( ioapic_reg_remapped(reg) )
+        return iommu_update_ire_from_apic(apic, reg, value);
+    *(IO_APIC_BASE(apic)+4) = value;
 }
 
 /* 1 if "noapic" boot option passed */