From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPDXx-0005Gd-2S for qemu-devel@nongnu.org; Fri, 19 Oct 2012 10:27:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TPDXo-0006x5-9T for qemu-devel@nongnu.org; Fri, 19 Oct 2012 10:27:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TPDXo-0006wq-1c for qemu-devel@nongnu.org; Fri, 19 Oct 2012 10:27:24 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9JERNQE008638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 19 Oct 2012 10:27:23 -0400 From: Luiz Capitulino Date: Fri, 19 Oct 2012 11:28:03 -0300 Message-Id: <1350656885-6485-5-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1350656885-6485-1-git-send-email-lcapitulino@redhat.com> References: <1350656885-6485-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 4/6] qemu-img: img_create(): drop unneeded goto and ret variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, armbru@redhat.com Signed-off-by: Luiz Capitulino --- qemu-img.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index a5f2969..dafe705 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -294,7 +294,7 @@ static int add_old_style_options(const char *fmt, QEMUOptionParameter *list, static int img_create(int argc, char **argv) { - int c, ret = 0; + int c; uint64_t img_size = -1; const char *fmt = "raw"; const char *base_fmt = NULL; @@ -351,15 +351,13 @@ static int img_create(int argc, char **argv) error_report("Invalid image size specified! You may use k, M, G or " "T suffixes for "); error_report("kilobytes, megabytes, gigabytes and terabytes."); - ret = -1; - goto out; + return 1; } img_size = (uint64_t)sval; } if (options && is_help_option(options)) { - ret = print_block_option_help(filename, fmt); - goto out; + return print_block_option_help(filename, fmt); } bdrv_img_create(filename, fmt, base_filename, base_fmt, @@ -367,13 +365,9 @@ static int img_create(int argc, char **argv) if (error_is_set(&local_err)) { error_report("%s", error_get_pretty(local_err)); error_free(local_err); - ret = -1; - } - -out: - if (ret) { return 1; } + return 0; } -- 1.7.12.315.g682ce8b