diff mbox

x86/paging: Make paging_mode_*() predecates behave like predicates

Message ID 1473328546-28007-1-git-send-email-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Cooper Sept. 8, 2016, 9:55 a.m. UTC
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Tim Deegan <tim@xen.org>
CC: George Dunlap <george.dunlap@eu.citrix.com>
---
 xen/include/asm-x86/paging.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Tim Deegan Sept. 8, 2016, 10 a.m. UTC | #1
At 10:55 +0100 on 08 Sep (1473332146), Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

s/predecates/predicates/, and Acked-by: Tim Deegan <tim@xen.org>
Andrew Cooper Sept. 8, 2016, 10:01 a.m. UTC | #2
On 08/09/16 11:00, Tim Deegan wrote:
> At 10:55 +0100 on 08 Sep (1473332146), Andrew Cooper wrote:
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> s/predecates/predicates/, and Acked-by: Tim Deegan <tim@xen.org>

Ah - so it is.  Will fix.

Thanks.

~Andrew
George Dunlap Sept. 8, 2016, 10:02 a.m. UTC | #3
On 08/09/16 10:55, Andrew Cooper wrote:
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

In case it needs it:

Acked-by: George Dunlap <george.dunlap@citrix.com>
diff mbox

Patch

diff --git a/xen/include/asm-x86/paging.h b/xen/include/asm-x86/paging.h
index a1401ab..56eef6b 100644
--- a/xen/include/asm-x86/paging.h
+++ b/xen/include/asm-x86/paging.h
@@ -57,14 +57,14 @@ 
  * requires VT or similar mechanisms */
 #define PG_external    (XEN_DOMCTL_SHADOW_ENABLE_EXTERNAL << PG_mode_shift)
 
-#define paging_mode_enabled(_d)   ((_d)->arch.paging.mode)
-#define paging_mode_shadow(_d)    ((_d)->arch.paging.mode & PG_SH_enable)
-#define paging_mode_hap(_d)       ((_d)->arch.paging.mode & PG_HAP_enable)
-
-#define paging_mode_refcounts(_d) ((_d)->arch.paging.mode & PG_refcounts)
-#define paging_mode_log_dirty(_d) ((_d)->arch.paging.mode & PG_log_dirty)
-#define paging_mode_translate(_d) ((_d)->arch.paging.mode & PG_translate)
-#define paging_mode_external(_d)  ((_d)->arch.paging.mode & PG_external)
+#define paging_mode_enabled(_d)   (!!(_d)->arch.paging.mode)
+#define paging_mode_shadow(_d)    (!!((_d)->arch.paging.mode & PG_SH_enable))
+#define paging_mode_hap(_d)       (!!((_d)->arch.paging.mode & PG_HAP_enable))
+
+#define paging_mode_refcounts(_d) (!!((_d)->arch.paging.mode & PG_refcounts))
+#define paging_mode_log_dirty(_d) (!!((_d)->arch.paging.mode & PG_log_dirty))
+#define paging_mode_translate(_d) (!!((_d)->arch.paging.mode & PG_translate))
+#define paging_mode_external(_d)  (!!((_d)->arch.paging.mode & PG_external))
 
 /* flags used for paging debug */
 #define PAGING_DEBUG_LOGDIRTY 0