x86/p2m: Reposition p2m_teardown_nestedp2m() to avoid its forward declaration
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 7 Feb 2017 15:15:56 +0000 (15:15 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 9 Feb 2017 10:39:03 +0000 (10:39 +0000)
While adjusting these functions, use unsigned int rather than uint8_t for the
loop variable, and fix the whitespace style.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/mm/p2m.c

index 874fae9e6764490520d160c242601643cc5e9a9a..db331536961dec5c1d7add802f504d18712ef425 100644 (file)
@@ -147,15 +147,29 @@ static void p2m_teardown_hostp2m(struct domain *d)
     }
 }
 
-static void p2m_teardown_nestedp2m(struct domain *d);
+static void p2m_teardown_nestedp2m(struct domain *d)
+{
+    unsigned int i;
+    struct p2m_domain *p2m;
+
+    for ( i = 0; i < MAX_NESTEDP2M; i++ )
+    {
+        if ( !d->arch.nested_p2m[i] )
+            continue;
+        p2m = d->arch.nested_p2m[i];
+        list_del(&p2m->np2m_list);
+        p2m_free_one(p2m);
+        d->arch.nested_p2m[i] = NULL;
+    }
+}
 
 static int p2m_init_nestedp2m(struct domain *d)
 {
-    uint8_t i;
+    unsigned int i;
     struct p2m_domain *p2m;
 
     mm_lock_init(&d->arch.nested_p2m_lock);
-    for (i = 0; i < MAX_NESTEDP2M; i++)
+    for ( i = 0; i < MAX_NESTEDP2M; i++ )
     {
         d->arch.nested_p2m[i] = p2m = p2m_init_one(d);
         if ( p2m == NULL )
@@ -171,22 +185,6 @@ static int p2m_init_nestedp2m(struct domain *d)
     return 0;
 }
 
-static void p2m_teardown_nestedp2m(struct domain *d)
-{
-    uint8_t i;
-    struct p2m_domain *p2m;
-
-    for (i = 0; i < MAX_NESTEDP2M; i++)
-    {
-        if ( !d->arch.nested_p2m[i] )
-            continue;
-        p2m = d->arch.nested_p2m[i];
-        list_del(&p2m->np2m_list);
-        p2m_free_one(p2m);
-        d->arch.nested_p2m[i] = NULL;
-    }
-}
-
 static void p2m_teardown_altp2m(struct domain *d)
 {
     unsigned int i;