From patchwork Mon Dec 28 05:16:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joshua Otto X-Patchwork-Id: 7924661 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 29D0EBEEE5 for ; Mon, 28 Dec 2015 05:21:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6010A20265 for ; Mon, 28 Dec 2015 05:21:00 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 551F220263 for ; Mon, 28 Dec 2015 05:20:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aDQBr-0003Nz-8d; Mon, 28 Dec 2015 05:17:51 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aDQBp-0003Nq-PQ for xen-devel@lists.xen.org; Mon, 28 Dec 2015 05:17:49 +0000 Received: from [193.109.254.147] by server-12.bemta-14.messagelabs.com id 60/CE-09834-DF5C0865; Mon, 28 Dec 2015 05:17:49 +0000 X-Env-Sender: jtotto@uwaterloo.ca X-Msg-Ref: server-6.tower-27.messagelabs.com!1451279867!13508061!1 X-Originating-IP: [129.97.128.141] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 29848 invoked from network); 28 Dec 2015 05:17:48 -0000 Received: from mailservices.uwaterloo.ca (HELO minos.uwaterloo.ca) (129.97.128.141) by server-6.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 28 Dec 2015 05:17:48 -0000 Received: from localhost.localdomain (milv-rb-1-200-147.nblk1.cyg.net [69.41.200.147]) (authenticated bits=0) by minos.uwaterloo.ca (8.14.4/8.14.4) with ESMTP id tBS5HB0X027204 (version=TLSv1/SSLv3 cipher=AES128-SHA256 bits=128 verify=NO); Mon, 28 Dec 2015 00:17:43 -0500 From: Joshua Otto To: ian.campbell@citrix.com, xen-devel@lists.xen.org Date: Mon, 28 Dec 2015 00:16:44 -0500 Message-Id: <1451279808-25264-2-git-send-email-jtotto@uwaterloo.ca> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451279808-25264-1-git-send-email-jtotto@uwaterloo.ca> References: <1450091323.16856.24.camel@citrix.com> <1451279808-25264-1-git-send-email-jtotto@uwaterloo.ca> X-UUID: 97508a4a-1d01-46b1-8d44-a38e8e4c857f Cc: wei.liu2@citrix.com, stefano.stabellini@eu.citrix.com, george.dunlap@eu.citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, czylin@uwaterloo.ca, Joshua Otto , hjarmstr@uwaterloo.ca Subject: [Xen-devel] [PATCH 1/5] libxl: tidy libxl_get_scheduler() according to CODING_STYLE X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To more closely follow the guidelines in CODING_STYLE, store the result of the libxc call in the local variable r, and the check the result of the call in a separate statement. Additionally, change the error log statement to more accurately reflect the failure. This is the only functional change introduced by this patch. Signed-off-by: Joshua Otto --- tools/libxl/libxl.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 9207621..ca4679b 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -5585,10 +5585,11 @@ out: libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx) { - libxl_scheduler sched, ret; GC_INIT(ctx); - if ((ret = xc_sched_id(ctx->xch, (int *)&sched)) != 0) { - LOGE(ERROR, "getting domain info list"); + libxl_scheduler sched; + int r = xc_sched_id(ctx->xch, (int *)&sched); + if (r != 0) { + LOGE(ERROR, "getting current scheduler id"); return ERROR_FAIL; GC_FREE; }