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

[Xen-changelog] [xen master] x86/shadow: convert non-const statics



commit b8dbddd31016992453e9725f5f27f8e183175183
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Jan 29 13:40:40 2015 +0000
Commit:     Tim Deegan <tim@xxxxxxx>
CommitDate: Thu Jan 29 13:44:28 2015 +0000

    x86/shadow: convert non-const statics
    
    To make obvious that such statics are safe to use, they should be
    const. In some of the cases, they wouldn't even need to be static, but
    keep them so upon the maintainer's request.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Tim Deegan <tim@xxxxxxx>
---
 xen/arch/x86/mm/shadow/common.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index b523a1c..7e6aeeb 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2162,7 +2162,7 @@ int sh_remove_write_access(struct vcpu *v, mfn_t gmfn,
         NULL  /* unused  */
     };
 
-    static unsigned int callback_mask = 
+    static const unsigned int callback_mask =
           1 << SH_type_l1_32_shadow
         | 1 << SH_type_fl1_32_shadow
         | 1 << SH_type_l1_pae_shadow
@@ -2412,7 +2412,7 @@ int sh_remove_all_mappings(struct vcpu *v, mfn_t gmfn)
         NULL  /* unused  */
     };
 
-    static unsigned int callback_mask = 
+    static const unsigned int callback_mask =
           1 << SH_type_l1_32_shadow
         | 1 << SH_type_fl1_32_shadow
         | 1 << SH_type_l1_pae_shadow
@@ -2556,7 +2556,7 @@ void sh_remove_shadows(struct vcpu *v, mfn_t gmfn, int 
fast, int all)
     };
 
     /* Another lookup table, for choosing which mask to use */
-    static unsigned int masks[SH_type_unused] = {
+    static const unsigned int masks[SH_type_unused] = {
         0, /* none    */
         1 << SH_type_l2_32_shadow, /* l1_32   */
         0, /* fl1_32  */
@@ -2683,7 +2683,7 @@ static int sh_clear_up_pointer(struct vcpu *v, mfn_t 
smfn, mfn_t unused)
 
 void sh_reset_l3_up_pointers(struct vcpu *v)
 {
-    static hash_callback_t callbacks[SH_type_unused] = {
+    static const hash_callback_t callbacks[SH_type_unused] = {
         NULL, /* none    */
         NULL, /* l1_32   */
         NULL, /* fl1_32  */
@@ -2701,7 +2701,7 @@ void sh_reset_l3_up_pointers(struct vcpu *v)
         NULL, /* p2m     */
         NULL  /* unused  */
     };
-    static unsigned int callback_mask = 1 << SH_type_l3_64_shadow;    
+    static const unsigned int callback_mask = 1 << SH_type_l3_64_shadow;
 
     hash_foreach(v, callback_mask, callbacks, _mfn(INVALID_MFN));
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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