From: "Jan Beulich" Subject: [PATCH] x86: replace some intpte_t * casts Date: Mon, 14 May 2007 17:16:44 +0200 Message-ID: <4648997C.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Don't cast values when other (type safe) mechanisms are available to = achieve the same effect. Signed-off-by: Jan Beulich Index: 2007-05-14/xen/arch/x86/mm.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 2007-05-14.orig/xen/arch/x86/mm.c 2007-05-14 08:40:14.000000000 = +0200 +++ 2007-05-14/xen/arch/x86/mm.c 2007-05-14 08:40:20.000000000 = +0200 @@ -1017,7 +1017,7 @@ static void pae_flush_pgd( l3tab_ptr =3D &cache->table[cache->inuse_idx][idx]; _ol3e =3D l3e_get_intpte(*l3tab_ptr); _nl3e =3D l3e_get_intpte(nl3e); - _pl3e =3D cmpxchg((intpte_t *)l3tab_ptr, _ol3e, _nl3e); + _pl3e =3D cmpxchg(&l3e_get_intpte(*l3tab_ptr), _ol3e, _nl3e); BUG_ON(_pl3e !=3D _ol3e); } =20 @@ -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)) =20 @@ -2498,7 +2498,7 @@ static int create_grant_pte_mapping( } =20 ol1e =3D *(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 =3D GNTST_general_error; @@ -3278,7 +3278,7 @@ static int ptwr_emulated_update( intpte_t t =3D old; ol1e =3D l1e_from_intpte(old); =20 - okay =3D paging_cmpxchg_guest_entry(v, (intpte_t *) pl1e,=20 + okay =3D paging_cmpxchg_guest_entry(v, &l1e_get_intpte(*pl1e), &t, val, _mfn(mfn)); okay =3D (okay && t =3D=3D old); =20