From: Chester Lin Date: Mon, 25 Jan 2016 00:45:34 +0000 (-0500) Subject: libxl: tidy libxl_get_scheduler() according to CODING_STYLE X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=337d298b0a071e55a0d934b9d8861828a35de4e8;p=people%2Fliuw%2Flibxenctrl-split%2Fxen.git libxl: tidy libxl_get_scheduler() according to CODING_STYLE To more closely follow the guidelines in CODING_STYLE, store the result of xc_sched_id() in the local variable r, and the check the result of the call in a separate statement. Change the type of the output parameter given to xc_sched_id() from libxl_scheduler to int to match the libxc interface. Additionally, change the error log statement to more accurately reflect the failure. This is the only functional change introduced by this patch. Suggested-by: Ian Campbell Signed-off-by: Chester Lin Reviewed-by: Dario Faggioli Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 2bde0f56da..52fefc0590 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -5580,10 +5580,12 @@ out: libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx) { - libxl_scheduler sched, ret; + int r, sched; + GC_INIT(ctx); - if ((ret = xc_sched_id(ctx->xch, (int *)&sched)) != 0) { - LOGE(ERROR, "getting domain info list"); + r = xc_sched_id(ctx->xch, &sched); + if (r != 0) { + LOGE(ERROR, "getting current scheduler id"); return ERROR_FAIL; GC_FREE; }