xen/cpupool: Fold error paths in cpupool_create()
PATCH 1/1 xen/cpupool: Fold error paths in cpupool_create()
The compiler can't fold because of the write to *perr in the first hunk.
No functional change, but slightly better compiled code.
Signed-off-by Andrew Cooper <[email protected]>
---
CC: Juergen Gross <[email protected]>
CC: Dario Faggioli <[email protected]>
--- xen/common/cpupool.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
xen/common/cpupool.c +7 -8
@@ -236,10 +236,8 @@ static struct cpupool *cpupool_create( {if ( (*q)->cpupool_id == poolid ) { -spin_unlock (&cpupool_lock); -free_cpupool_struct (c); *perr = -EEXIST ; -return NULL ; + goto err; } c->next = *q; }
@@ -253,11 +251,7 @@ static struct cpupool *cpupool_create( { c->sched =scheduler_alloc (sched_id, perr);if ( c->sched ==NULL ) - { -spin_unlock (&cpupool_lock); -free_cpupool_struct (c); -return NULL ; - } + goto err; } c->gran = opt_sched_granularity;
@@ -270,6 +264,11 @@ static struct cpupool *cpupool_create( *perr =0 ;return c; + + err: +spin_unlock (&cpupool_lock); +free_cpupool_struct (c); +return NULL ; }/* * destroys the given cpupool
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 5 lines · Andrew Cooper
The compiler can't fold because of the write to *perr in the first hunk.
No functional change, but slightly better compiled code.
Signed-off-by Andrew Cooper <[email protected]>
Reviewed-by Juergen Gross <[email protected]>
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel