From patchwork Fri Apr 8 02:24:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Faggioli X-Patchwork-Id: 8779731 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 705DC9F39A for ; Fri, 8 Apr 2016 02:26:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A17F42025B for ; Fri, 8 Apr 2016 02:26:15 +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 C13C220263 for ; Fri, 8 Apr 2016 02:26:14 +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 1aoM5m-0005F1-CO; Fri, 08 Apr 2016 02:24:14 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoM5l-0005EO-Bu for xen-devel@lists.xenproject.org; Fri, 08 Apr 2016 02:24:13 +0000 Received: from [85.158.139.211] by server-7.bemta-5.messagelabs.com id 6F/F9-22167-C4617075; Fri, 08 Apr 2016 02:24:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPIsWRWlGSWpSXmKPExsXiVRvkrOstxh5 usOuTtcX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmvH6XkbBJ46KpradTA2MZ9m7GLk4hASmMkp0 rf/PAuKwCKxhlfjy8w6YIyFwiVXi2fS3bF2MnEBOjMTO+eeZIOxSia5Ds8DiQgIqEje3r2KCs JcwSfx4YwliCwvoSRw5+oMdwg6UOPfoKZjNJmAg8WbHXlYQW0RASeLeqslAvRwczAJlEmvuVI KEWQRUJbb/mg5WzitgK7G4cQ8jiM0pYC9x/e89ZpByIQE7iasP5EDCogJyEisvt7BClAtKnJz 5hAVioqbE+l36IGFmAXmJ7W/nME9gFJmFpGoWQtUsJFULGJlXMWoUpxaVpRbpGprrJRVlpmeU 5CZm5ugaGpjq5aYWFyemp+YkJhXrJefnbmIEBj4DEOxgvHja8xCjJAeTkiivDx97uBBfUn5KZ UZicUZ8UWlOavEhRhkODiUJ3l8iQDnBotT01Iq0zBxgDMKkJTh4lER4BUWB0rzFBYm5xZnpEK lTjLocW6beW8skxJKXn5cqJc4rDlIkAFKUUZoHNwKWDi4xykoJ8zICHSXEU5BalJtZgir/ilG cg1FJmNcUZApPZl4J3KZXQEcwAR1xgZ8N5IiSRISUVAOjx6HPgTP8G35pC1/9d7J1P1PT+i3m InGXbojwrHDiXX13inDMhopXu/PU6pq0C0uYNV2+ZeQ6F3V7XOh4/pL7dGLt9p2WetubRFawG 2ttWiBxR2dW99ULp8VZD0z5NGHL1g2iJTcVL62Vnv/mx6GjWXn7J+jyTJiTmXuqpe6B6WqPe0 teFt7uVWIpzkg01GIuKk4EANsXM+ACAwAA X-Env-Sender: raistlin.df@gmail.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1460082251!33300454!1 X-Originating-IP: [74.125.82.67] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 43825 invoked from network); 8 Apr 2016 02:24:11 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-6.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 8 Apr 2016 02:24:11 -0000 Received: by mail-wm0-f67.google.com with SMTP id l6so942870wml.3 for ; Thu, 07 Apr 2016 19:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=JkFeHU9IA/nT0yviA8t/sLbPcqUV04seQCeOEH6UblA=; b=ApbJYtnsJCF/SVtGRW253cETEDo7BRPRdHHFDnloSniTzmPFtcs2GO9AL3QxhJQNT4 4k7a1lwBhZoWEdPwCxk44xqaYPaqDUHCMv8a0sRLtIANgIExxeMVyQEzNod2CA9o21Fi SnMJu3+SKMFN1BuDyHwiN/szOfrbO+HIWP0cj/OvzKiUJfO3SZ9/YFfbCXyavGJk02y9 DzkmCu7K3qdB4mQqBz0RF2ISK+44eP5+LaosBcUgMu+YSdTjntDij3ePKiGZRchguFhz o66b2Dk64zhEixwxmsnSd/f5j2inF+D5FzkrFxV+SgLcE5sk4Yt/UTOTzdo7XVBtHBd0 u+cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:from:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=JkFeHU9IA/nT0yviA8t/sLbPcqUV04seQCeOEH6UblA=; b=OrBZjx9GnMp4ZnSLpbjJLBcmVwGGQMRMsBf/GolKKrT6JOHLPAyANvklvhJRrZmMlO Kknx9z9Yo0ST9OV6leZSVypFNeWpjqR/z48XHQuVUnjBaxeathyp+R9jNIev/Pn4CRTj h2vwBGj0wTNneaSG512CFR6m5W9A1fgRKmOXBIJYD5N9du/0z2F9qenO70dXuLcVTAij zgWlKSnrshEvSlIQ8CgBQyAF4eZU2AGyIxVw/cfSntJ364mySOSB7E2WBjXN/Uk0B1wM DzFflrIRqhQbPmgw2d4US0u7do5zYom7yqjEuL4rhIGzwR2YpNUvQP3TppZuS2wSN1QO WsNQ== X-Gm-Message-State: AD7BkJI6BMbNj9+/YSPDyDN67iUQBok4C9NB0KgZMXA4Sl6E0jA0fUFg06nkg5QLogfcwQ== X-Received: by 10.28.23.75 with SMTP id 72mr811367wmx.50.1460082251711; Thu, 07 Apr 2016 19:24:11 -0700 (PDT) Received: from Solace.fritz.box (net-37-116-155-252.cust.vodafonedsl.it. [37.116.155.252]) by smtp.gmail.com with ESMTPSA id kj9sm11150434wjb.14.2016.04.07.19.24.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Apr 2016 19:24:10 -0700 (PDT) From: Dario Faggioli To: xen-devel@lists.xenproject.org Date: Fri, 08 Apr 2016 04:24:07 +0200 Message-ID: <20160408022407.9058.8250.stgit@Solace.fritz.box> In-Reply-To: <20160408022241.9058.86808.stgit@Solace.fritz.box> References: <20160408022241.9058.86808.stgit@Solace.fritz.box> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Cc: Wei Liu , Ian Jackson , Andrew Cooper Subject: [Xen-devel] [PATCH v3 5/6] xl: make return type of create_domain() more consistent. 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: , 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_SIGNED, 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 create_domain() is of uint32_t return type, because on success it returns the domid of the new domain, and uint32_t is what we typically use for domid-s. However, on failure, it returns ERROR_FAIL or ERROR_INVAL, which are -3 and -6. Callers assign the return value to an 'int rc' variable and then check for '(rc < 0)'. Although things work, and no tool (compiler, Coverity, ecc.) is complaining, using 'int' as return type seems better. Signed-off-by: Dario Faggioli Acked-by: Wei Liu --- Cc: Ian Jackson Cc: Wei Liu Cc: Andrew Cooper --- tools/libxl/xl_cmdimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 823cb46..d2ad8c8 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -2777,7 +2777,7 @@ static void evdisable_disk_ejects(libxl_evgen_disk_eject **diskws, } } -static uint32_t create_domain(struct domain_create *dom_info) +static int create_domain(struct domain_create *dom_info) { uint32_t domid = INVALID_DOMID;