# HG changeset patch
# User Jimi Xenidis <[EMAIL PROTECTED]>
# Node ID 0b82e0cba7d3676bc5ca619cd57047f03bbce253
# Parent  584e21f08d0c092170a6879892b43efe860e2a9c
[POWERPC] xencomm simplify
No need for 2 virtual to physical routines and trim off the "__"'s.

Signed-off-by: Jimi Xenidis <[EMAIL PROTECTED]>
---
 drivers/xen/core/xencomm.c |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diff -r 584e21f08d0c -r 0b82e0cba7d3 drivers/xen/core/xencomm.c
--- a/drivers/xen/core/xencomm.c        Thu Aug 10 16:36:39 2006 -0400
+++ b/drivers/xen/core/xencomm.c        Thu Aug 10 16:53:52 2006 -0400
@@ -24,7 +24,7 @@ int xencomm_debug;
 int xencomm_debug;
 
 /* translate virtual address to physical address */
-static unsigned long __vaddr_to_paddr(unsigned long vaddr)
+static unsigned long xen_vaddr_to_paddr(unsigned long vaddr)
 {
        struct page *page;
        struct vm_area_struct *vma;
@@ -46,15 +46,8 @@ static unsigned long __vaddr_to_paddr(un
        return (page_to_pfn(page) << PAGE_SHIFT) | (vaddr & ~PAGE_MASK);
 }
 
-/* for use with kernel buffers before __vaddr_to_paddr works (e.g. boot
- * console) */
-static unsigned long __kern_paddr(unsigned long vaddr)
-{
-       return __pa(vaddr);
-}
-
-static int __xencomm_init(struct xencomm_desc *desc, void *buffer,
-               unsigned long bytes, unsigned long (*to_phys)(unsigned long))
+static int xencomm_init(struct xencomm_desc *desc,
+                       void *buffer, unsigned long bytes)
 {
        unsigned long recorded = 0;
        int i = 0;
@@ -74,7 +67,7 @@ static int __xencomm_init(struct xencomm
                offset = vaddr % PAGE_SIZE; /* handle partial pages */
                chunksz = min(PAGE_SIZE - offset, bytes - recorded);
 
-               paddr = to_phys(vaddr);
+               paddr = xen_vaddr_to_paddr(vaddr);
                if (paddr == ~0UL) {
                        printk("%s: couldn't translate vaddr %lx\n",
                               __func__, vaddr);
@@ -141,9 +134,9 @@ int xencomm_create(void *buffer, unsigne
                return -ENOMEM;
        }
 
-       rc = __xencomm_init(desc, buffer, bytes, __vaddr_to_paddr);
+       rc = xencomm_init(desc, buffer, bytes);
        if (rc) {
-               printk("%s failure: %d\n", "__xencomm_init", rc);
+               printk("%s failure: %d\n", "xencomm_init", rc);
                xencomm_free(desc);
                return rc;
        }
@@ -154,7 +147,7 @@ int xencomm_create(void *buffer, unsigne
 
 /* "mini" routines, for stack-based communications: */
 
-static void *__xencomm_alloc_mini(void *area, int arealen)
+static void *xencomm_alloc_mini(void *area, int arealen)
 {
        unsigned long base = (unsigned long)area;
        unsigned int pageoffset;
@@ -180,12 +173,12 @@ int xencomm_create_mini(void *area, int 
        struct xencomm_desc *desc;
        int rc;
 
-       desc = __xencomm_alloc_mini(area, arealen);
+       desc = xencomm_alloc_mini(area, arealen);
        if (!desc)
                return -ENOMEM;
        desc->nr_addrs = XENCOMM_MINI_ADDRS;
 
-       rc = __xencomm_init(desc, buffer, bytes, __kern_paddr);
+       rc = xencomm_init(desc, buffer, bytes);
        if (rc)
                return rc;
 

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel

Reply via email to