[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/4] xen/arch: Switch local_*_is_enabled() predicates to return bool



No functional change, as the value returned was previously always 0 or 1.
While altering these, insert blank lines where appropriate and drop the
now-redundant !! from x86's local_irq_is_enabled().

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Stefano Stabellini <sstabellini@xxxxxxxxxx>
CC: Julien Grall <julien.grall@xxxxxxx>
---
 xen/include/asm-arm/arm32/system.h | 8 ++++++--
 xen/include/asm-arm/arm64/system.h | 8 ++++++--
 xen/include/asm-arm/system.h       | 4 +++-
 xen/include/asm-x86/system.h       | 6 ++++--
 4 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/xen/include/asm-arm/arm32/system.h 
b/xen/include/asm-arm/arm32/system.h
index ab57abf..58c8fb3 100644
--- a/xen/include/asm-arm/arm32/system.h
+++ b/xen/include/asm-arm/arm32/system.h
@@ -28,10 +28,12 @@
             : "memory", "cc");                                   \
 })
 
-static inline int local_irq_is_enabled(void)
+static inline bool local_irq_is_enabled(void)
 {
     unsigned long flags;
+
     local_save_flags(flags);
+
     return !(flags & PSR_IRQ_MASK);
 }
 
@@ -41,10 +43,12 @@ static inline int local_irq_is_enabled(void)
 #define local_abort_enable() __asm__("cpsie a  @ __sta\n" : : : "memory", "cc")
 #define local_abort_disable() __asm__("cpsid a @ __sta\n" : : : "memory", "cc")
 
-static inline int local_fiq_is_enabled(void)
+static inline bool local_fiq_is_enabled(void)
 {
     unsigned long flags;
+
     local_save_flags(flags);
+
     return !(flags & PSR_FIQ_MASK);
 }
 
diff --git a/xen/include/asm-arm/arm64/system.h 
b/xen/include/asm-arm/arm64/system.h
index 2e36573..d17fc9d 100644
--- a/xen/include/asm-arm/arm64/system.h
+++ b/xen/include/asm-arm/arm64/system.h
@@ -44,17 +44,21 @@
         : "memory");                                             \
 })
 
-static inline int local_irq_is_enabled(void)
+static inline bool local_irq_is_enabled(void)
 {
     unsigned long flags;
+
     local_save_flags(flags);
+
     return !(flags & PSR_IRQ_MASK);
 }
 
-static inline int local_fiq_is_enabled(void)
+static inline bool local_fiq_is_enabled(void)
 {
     unsigned long flags;
+
     local_save_flags(flags);
+
     return !(flags & PSR_FIQ_MASK);
 }
 
diff --git a/xen/include/asm-arm/system.h b/xen/include/asm-arm/system.h
index b94e56f..bc51300 100644
--- a/xen/include/asm-arm/system.h
+++ b/xen/include/asm-arm/system.h
@@ -51,10 +51,12 @@
 # error "unknown ARM variant"
 #endif
 
-static inline int local_abort_is_enabled(void)
+static inline bool local_abort_is_enabled(void)
 {
     unsigned long flags;
+
     local_save_flags(flags);
+
     return !(flags & PSR_ABT_MASK);
 }
 
diff --git a/xen/include/asm-x86/system.h b/xen/include/asm-x86/system.h
index 483cd20..4b7056d 100644
--- a/xen/include/asm-x86/system.h
+++ b/xen/include/asm-x86/system.h
@@ -274,11 +274,13 @@ static inline unsigned long 
array_index_mask_nospec(unsigned long index,
                        "ri" ( (x) & X86_EFLAGS_IF ) );           \
 })
 
-static inline int local_irq_is_enabled(void)
+static inline bool local_irq_is_enabled(void)
 {
     unsigned long flags;
+
     local_save_flags(flags);
-    return !!(flags & X86_EFLAGS_IF);
+
+    return flags & X86_EFLAGS_IF;
 }
 
 #define BROKEN_ACPI_Sx          0x0001
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.