Bool defaults to at least byte width. We usually only want to waste a single
bit on this. So let's move all the bool values to bitfields, potentially
saving memory.

Signed-off-by: Alexander Graf <ag...@suse.de>
---
 arch/powerpc/include/asm/kvm_book3s.h |   28 ++++++++++++++--------------
 arch/powerpc/include/asm/kvm_host.h   |    6 +++---
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_book3s.h 
b/arch/powerpc/include/asm/kvm_book3s.h
index 8a6b4c5..ee79921 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -29,40 +29,40 @@ struct kvmppc_slb {
        u64 vsid;
        u64 orige;
        u64 origv;
-       bool valid;
-       bool Ks;
-       bool Kp;
-       bool nx;
-       bool large;     /* PTEs are 16MB */
-       bool tb;        /* 1TB segment */
-       bool class;
+       bool valid      : 1;
+       bool Ks         : 1;
+       bool Kp         : 1;
+       bool nx         : 1;
+       bool large      : 1;    /* PTEs are 16MB */
+       bool tb         : 1;    /* 1TB segment */
+       bool class      : 1;
 };
 
 struct kvmppc_sr {
        u32 raw;
        u32 vsid;
-       bool Ks;
-       bool Kp;
-       bool nx;
-       bool valid;
+       bool Ks         : 1;
+       bool Kp         : 1;
+       bool nx         : 1;
+       bool valid      : 1;
 };
 
 struct kvmppc_bat {
        u64 raw;
        u32 bepi;
        u32 bepi_mask;
-       bool vs;
-       bool vp;
        u32 brpn;
        u8 wimg;
        u8 pp;
+       bool vs         : 1;
+       bool vp         : 1;
 };
 
 struct kvmppc_sid_map {
        u64 guest_vsid;
        u64 guest_esid;
        u64 host_vsid;
-       bool valid;
+       bool valid      : 1;
 };
 
 #define SID_MAP_BITS    9
diff --git a/arch/powerpc/include/asm/kvm_host.h 
b/arch/powerpc/include/asm/kvm_host.h
index 486f1ca..5869a48 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -127,9 +127,9 @@ struct kvmppc_pte {
        u64 eaddr;
        u64 vpage;
        u64 raddr;
-       bool may_read;
-       bool may_write;
-       bool may_execute;
+       bool may_read           : 1;
+       bool may_write          : 1;
+       bool may_execute        : 1;
 };
 
 struct kvmppc_mmu {
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to