From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chester Lin Subject: [PATCH v2 1/5] libxl: tidy libxl_get_scheduler() according to CODING_STYLE Date: Tue, 19 Jan 2016 00:57:08 -0500 Message-ID: <1453183028-50263-1-git-send-email-czylin@uwaterloo.ca> References: <1451982030.27063.30.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1451982030.27063.30.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, Chester Lin , jtotto@uwaterloo.ca, hjarmstr@uwaterloo.ca List-Id: xen-devel@lists.xenproject.org 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 --- Now storing the return of xc_sched_id in an int as per On Mon, 2016-01-04 at 16:23 +0000, Ian Campbell wrote: >Safer (and cleaner looking even if I'm wrong) would be to use a temporary >int for the function call and turn it into an enum implicitly in the return --- tools/libxl/libxl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 9207621..7f28af8 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -5585,10 +5585,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; } -- 1.9.5.msysgit.0