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

[Xen-changelog] [xen-unstable] x86: replace some intpte_t * casts



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1179220100 -3600
# Node ID b2adb797900ad15e884de72782efb7e0bf12d58b
# Parent  05ea0d79a92f1d5b71c00d7e760b61cbcdbdb3ce
x86: replace some intpte_t * casts

Don't cast values when other (type safe) mechanisms are available to =
achieve the same effect.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/arch/x86/mm.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r 05ea0d79a92f -r b2adb797900a xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Tue May 15 10:03:58 2007 +0100
+++ b/xen/arch/x86/mm.c Tue May 15 10:08:20 2007 +0100
@@ -1017,7 +1017,7 @@ static void pae_flush_pgd(
             l3tab_ptr = &cache->table[cache->inuse_idx][idx];
             _ol3e = l3e_get_intpte(*l3tab_ptr);
             _nl3e = l3e_get_intpte(nl3e);
-            _pl3e = cmpxchg((intpte_t *)l3tab_ptr, _ol3e, _nl3e);
+            _pl3e = cmpxchg(&l3e_get_intpte(*l3tab_ptr), _ol3e, _nl3e);
             BUG_ON(_pl3e != _ol3e);
         }
 
@@ -1316,7 +1316,7 @@ static inline int update_intpte(intpte_t
 /* Macro that wraps the appropriate type-changes around update_intpte().
  * Arguments are: type, ptr, old, new, mfn, vcpu */
 #define UPDATE_ENTRY(_t,_p,_o,_n,_m,_v)                             \
-    update_intpte((intpte_t *)(_p),                                 \
+    update_intpte(&_t ## e_get_intpte(*(_p)),                       \
                   _t ## e_get_intpte(_o), _t ## e_get_intpte(_n),   \
                   (_m), (_v))
 
@@ -2498,7 +2498,7 @@ static int create_grant_pte_mapping(
     }
 
     ol1e = *(l1_pgentry_t *)va;
-    if ( !UPDATE_ENTRY(l1, va, ol1e, nl1e, mfn, v) )
+    if ( !UPDATE_ENTRY(l1, (l1_pgentry_t *)va, ol1e, nl1e, mfn, v) )
     {
         put_page_type(page);
         rc = GNTST_general_error;
@@ -3278,7 +3278,7 @@ static int ptwr_emulated_update(
         intpte_t t = old;
         ol1e = l1e_from_intpte(old);
 
-        okay = paging_cmpxchg_guest_entry(v, (intpte_t *) pl1e, 
+        okay = paging_cmpxchg_guest_entry(v, &l1e_get_intpte(*pl1e),
                                           &t, val, _mfn(mfn));
         okay = (okay && t == old);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.