File 25860-tmem-cleanup.patch of Package xen.openSUSE_12.1_Update
# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1347365969 -7200
# Node ID e4cb8411161043c726f699252cc761e77853e820
# Parent 16e0392c6594b1757bbaa82076630a73d843229b
tmem: cleanup
- one more case of checking for a specific rather than any error
- drop a redundant casts
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -1471,7 +1471,7 @@ static NOINLINE int do_tmem_put_compress
pgp_free_data(pgp, pgp->us.obj->pool);
START_CYC_COUNTER(compress);
ret = tmh_compress_from_client(cmfn, &dst, &size, clibuf);
- if ( (ret == -EFAULT) || (ret == 0) )
+ if ( ret <= 0 )
goto out;
else if ( (size == 0) || (size >= tmem_subpage_maxsize()) ) {
ret = 0;
--- a/xen/common/tmem_xen.c
+++ b/xen/common/tmem_xen.c
@@ -121,7 +121,7 @@ static inline void *cli_get_page(tmem_cl
if ( !ret )
return NULL;
*pcli_mfn = cli_mfn;
- *pcli_pfp = (pfp_t *)page;
+ *pcli_pfp = page;
return map_domain_page(cli_mfn);
}
@@ -130,11 +130,11 @@ static inline void cli_put_page(void *cl
{
if ( mark_dirty )
{
- put_page_and_type((struct page_info *)cli_pfp);
+ put_page_and_type(cli_pfp);
paging_mark_dirty(current->domain,cli_mfn);
}
else
- put_page((struct page_info *)cli_pfp);
+ put_page(cli_pfp);
unmap_domain_page(cli_va);
}
#endif