x86/p2m: Reposition p2m_teardown_nestedp2m() to avoid its forward declaration
PATCH 1/1 x86/p2m: Reposition p2m_teardown_nestedp2m() to avoid its forward declaration
While adjusting these functions, use unsigned int rather than uint8_t for the loop variable, and fix the whitespace style.
No functional change.
---
CC: Jan Beulich <[email protected]>
CC: Tim Deegan <[email protected]>
CC: George Dunlap <[email protected]>
--- xen/arch/x86/mm/p2m.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-)
xen/arch/x86/mm/p2m.c +17 -19
@@ -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;
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 07.02.17 at 19:43, <[email protected]> wrote:
While adjusting these functions, use unsigned int rather than
uint8_tfor the loop variable, and fix the whitespace style.No functional change.
Signed-off-by Andrew Cooper <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 4 lines · Andrew Cooper
While adjusting these functions, use unsigned int rather than
uint8_tfor the loop variable, and fix the whitespace style.No functional change.
I think changing a variable from 8 to 64 bits might count as a functional change; but anyway:
Quoted 61 lines
Signed-off-by Andrew Cooper <[email protected]>---
CC: Jan Beulich <[email protected]>
CC: Tim Deegan <[email protected]>
CC: George Dunlap <[email protected]>--- xen/arch/x86/mm/p2m.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-)xen/arch/x86/mm/p2m.c +17
-12@@ -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 ;
xen/arch/x86/mm/p2m.c static int p2m_init_nestedp2m(struct domain *d) · line 190
Quoted 10 lines
xen/arch/x86/mm/p2m.c +0
-7- 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;
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel