From patchwork Fri Apr 1 12:40:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulina Szubarczyk X-Patchwork-Id: 8723491 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 62706C0553 for ; Fri, 1 Apr 2016 12:43:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8CAD7203C2 for ; Fri, 1 Apr 2016 12:43:27 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E75A720303 for ; Fri, 1 Apr 2016 12:43:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1alyNv-00015t-Kc; Fri, 01 Apr 2016 12:41:07 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1alyNv-00015S-0T for xen-devel@lists.xenproject.org; Fri, 01 Apr 2016 12:41:07 +0000 Received: from [85.158.139.211] by server-3.bemta-5.messagelabs.com id 43/86-25417-26C6EF65; Fri, 01 Apr 2016 12:41:06 +0000 X-Env-Sender: paulinaszubarczyk@gmail.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1459514465!20225736!1 X-Originating-IP: [209.85.215.43] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 9149 invoked from network); 1 Apr 2016 12:41:05 -0000 Received: from mail-lf0-f43.google.com (HELO mail-lf0-f43.google.com) (209.85.215.43) by server-11.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 1 Apr 2016 12:41:05 -0000 Received: by mail-lf0-f43.google.com with SMTP id p188so53642235lfd.0 for ; Fri, 01 Apr 2016 05:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=B0e8DvWxogCjuL/Hcc5oXWjBCoYArGhQ9jYzt42xNSY=; b=LfnjOwx97T6ppmvh1XU1UlfEYgr3XafPG+z2ygA6ORs+b9Nn17fA3nR6qrfnNBeTwY 6WbvofnauzLeE2C2hysIuBIuQwoMqA1cRwfPKI8ZyJev+0gwEnG58Hsvyz7SvGHdocd8 dbfrLFFs5O6XKjyE6TrVZVz6zQ72L4I/QjPtEo1KNZpnCEuBIv+TFZwTfld0JwOyzUyL EqjhaGyXoyODCChKl9JlhxdNLs6HHLOETcuuqJPps0u3izYpLa/8jRtvi4mgz4fvNiq5 KtPiVF7AVRWKzA6GHW9W9FQS/svQHAdUpJTB1IXLcfRgYI3jNf9RigM+5v6vlfh0y8Jb xsaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=B0e8DvWxogCjuL/Hcc5oXWjBCoYArGhQ9jYzt42xNSY=; b=AJUIt2dCFHFfRyI+RffePl5mE45JmuKYtLafj2SuNiEZzUChh3MJu2VEX7FDJOz2dv 2objgtUL1UyWMfTkrx96SRC272o6atCWMyQffLf7rV1ahfaWRHqpyE582ul1DRPj/kTI AKscSdK4lkXFUq+qhOwO5+hNjcbBrWzgLrn9znaul/exSRo76XXMEib1Ek0rqANxJFxb cV0tSUUsWgl78hriUS4/Bty4EZRKd21YS/ZNkCB92pqjnJ4z5A5QnDNh464QHwf+TBDo 6qI6gzk4Mf+Ja9dCrs/KiggCWAt9DFID87NyTX58wqNL0bZ7TytsfHtdYO48gy+BZ7IT G5LA== X-Gm-Message-State: AD7BkJJ0WDtdcmMnAM4fv1tBn3F7umtTcFqyXbJr57V+KHTU8Ue3t/03sdYT8bspcD2J8Q== X-Received: by 10.25.82.203 with SMTP id g194mr1883278lfb.1.1459514465131; Fri, 01 Apr 2016 05:41:05 -0700 (PDT) Received: from localhost.localdomain (84-10-74-207.static.chello.pl. [84.10.74.207]) by smtp.gmail.com with ESMTPSA id do4sm2134801lbc.35.2016.04.01.05.41.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Apr 2016 05:41:04 -0700 (PDT) From: Paulina Szubarczyk To: xen-devel@lists.xenproject.org, roger.pau@citrix.com, George.Dunlap@eu.citrix.com Date: Fri, 1 Apr 2016 14:40:04 +0200 Message-Id: <1459514413-18682-2-git-send-email-paulinaszubarczyk@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459514413-18682-1-git-send-email-paulinaszubarczyk@gmail.com> References: <1459514413-18682-1-git-send-email-paulinaszubarczyk@gmail.com> Cc: Paulina Szubarczyk , dario.faggioli@citrix.com, wei.liu2@citrix.com, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH 01/10] libxl_pci: improve return codes for more xl commands X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, 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 Retrun error code instead of allways 0. Remove assigned-only ret variable. Signed-off-by: Paulina Szubarczyk --- tools/libxl/libxl_pci.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index dc10cb7..3435ce2 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -84,13 +84,11 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid, flexarray_t *front = NULL; flexarray_t *back = NULL; libxl__device device; - int ret = ERROR_NOMEM, i; + int i; front = flexarray_make(gc, 16, 1); back = flexarray_make(gc, 16, 1); - ret = 0; - LOG(DEBUG, "Creating pci backend"); /* add pci device */ @@ -108,12 +106,10 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t domid, flexarray_append_pair(front, "backend-id", GCSPRINTF("%d", 0)); flexarray_append_pair(front, "state", GCSPRINTF("%d", XenbusStateInitialising)); - libxl__device_generic_add(gc, XBT_NULL, &device, + return libxl__device_generic_add(gc, XBT_NULL, &device, libxl__xs_kvs_of_flexarray(gc, back, back->count), libxl__xs_kvs_of_flexarray(gc, front, front->count), NULL); - - return 0; } static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, int starting)