From patchwork Mon Jan 6 18:23:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218336 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JWJv08rP"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s3q606grz9s29 for ; Tue, 7 Jan 2020 05:25:54 +1100 (AEDT) Received: from localhost ([::1]:57650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4Z-0001Ow-9G for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:25:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44926) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3f-0001Mm-Tv for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:24:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3e-0003dR-Q6 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:24:55 -0500 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:39310) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3e-0003d3-KO; Mon, 06 Jan 2020 13:24:54 -0500 Received: by mail-qk1-x744.google.com with SMTP id c16so40275737qko.6; Mon, 06 Jan 2020 10:24:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BPtzP3vwdKJDYfiK+1V5sLIQfxo+hk+yi1CNnAf7kDI=; b=JWJv08rPQVD7dn31fA27RO0L1TkNs1eZ9KXvmtdm0n7e2b3V2eAIbZttqeAX1H5Rte Avc+0JE3rvoP7GzJvhfOJ5ewaz3VJA8JSAMPIEbsKh1adEh4g1QXbfSEVxbQjoFqikk4 BtI1GUO3uQlj9ymIAnA6TsItIgbn3CABvoQb5Qd3aeGUH+/2fAjRGSSclE99FWzTI1zS D7IiLxILsyuC3+Yfx5T6a7s8n1INXpR9QVEZWm2K2cnvrQQtTrSACyBoKJzs8nYrD7Ja Tqfhpqa1OHtwL+kO1m+RmsjjWV5ViP3i7YswqofiguV26EAZYI6iOFXTk7q94UMJcUpy g37w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BPtzP3vwdKJDYfiK+1V5sLIQfxo+hk+yi1CNnAf7kDI=; b=LNkij0JqX25hjDF3zASaW8heATGHWZGBMDFdsMaoyIm1NBkd/A5N4WywYMPNv+J2Ev aYEniwLzUayM7S/280bJvCFSUwT5CCV6ZevYjcRmC54xKwUwGRLOv/ovJUBligb9R5rZ QU5nVvJm7iRuUFGugxetpo/V2qZ2Mdl9EIVI4zXrLFgOUisBeO+8oepvdPS8NbNYpdg+ hSXDpJAy+hJizn+xaHMXfsY2zNXjuTIz2itK7q1w+nOv3FLMnj2kzS9ZzdgO4J5fa+SY dBoM9aBu9glhNtiggpj6swbu9fmUKRzKB7YoBTKveDP2L9Ggi/b/01nsREaUs0WvN8yV /1vA== X-Gm-Message-State: APjAAAUqb+GePkxdx7yVyxDQ1ZikRp4kdbiAeCW28pUjsW3kWChCX+05 gBFi1C91RC8wiiPRaRRLQi4Qt76s X-Google-Smtp-Source: APXvYqzSvXtub0j4T5AEHx49CbNdWuauWRDEVcXL7gZSK9eZLojO15sNyMdKc7IVkJTQgyCJfdjIaw== X-Received: by 2002:a37:48f:: with SMTP id 137mr83913337qke.25.1578335093972; Mon, 06 Jan 2020 10:24:53 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:24:53 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 01/59] spapr.c: remove 'out' label in spapr_dt_cas_updates() Date: Mon, 6 Jan 2020 15:23:27 -0300 Message-Id: <20200106182425.20312-2-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' can be replaced by 'return' with the appropriate return value. CC: David Gibson CC: qemu-ppc@nongnu.org Signed-off-by: Daniel Henrique Barboza --- hw/ppc/spapr.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index f11422fc41..1bfe47337c 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -878,7 +878,7 @@ static int spapr_dt_cas_updates(SpaprMachineState *spapr, void *fdt, g_assert(smc->dr_lmb_enabled); ret = spapr_populate_drconf_memory(spapr, fdt); if (ret) { - goto out; + return ret; } } @@ -889,11 +889,8 @@ static int spapr_dt_cas_updates(SpaprMachineState *spapr, void *fdt, return offset; } } - ret = spapr_ovec_populate_dt(fdt, offset, spapr->ov5_cas, - "ibm,architecture-vec-5"); - -out: - return ret; + return spapr_ovec_populate_dt(fdt, offset, spapr->ov5_cas, + "ibm,architecture-vec-5"); } static void spapr_dt_rtas(SpaprMachineState *spapr, void *fdt) From patchwork Mon Jan 6 18:23:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218337 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NYbCZL8k"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s3q962M6z9sR4 for ; Tue, 7 Jan 2020 05:25:57 +1100 (AEDT) Received: from localhost ([::1]:57652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4c-0001Ta-SW for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:25:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44949) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3h-0001OH-B3 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:24:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3g-0003el-Ao for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:24:57 -0500 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:43278) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3g-0003eZ-77; Mon, 06 Jan 2020 13:24:56 -0500 Received: by mail-qt1-x843.google.com with SMTP id d18so40492830qtj.10; Mon, 06 Jan 2020 10:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9UmeSQEs5rob9wrTq2qmb04fnkLXv4NpiQ8wHgmBhdQ=; b=NYbCZL8kRRwem5Io6W0Rv8fJs/luyPrKXDV1i3FI2TMztdEE2dMIcwM/vU9maVNhMr 3t/FqCrKWy4GHh/Eg5tg83YQSid3KvIYEt8oVX4BgLS31EPmbiAUw8D1N6od7AN6EWgJ +gC9gaEX5EMeVvc1Yi/7276dYGW2YURBRGmzphfT2dY1/+vDAcKaXMgx43iNa8rbcgP4 xM+UQIbFsd9WrLaQR+WgCTNlPOW2AM+BfM/04WqOozqXaqChsE8o1y9RxXaHQ1iC3h5m h9s5IJyzmh8oFC9Ec9/VrAaPyUn7a4fJH66QHNm75vUZCcIGWd0C2cZA7bVwMgjLkRnt 7sGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9UmeSQEs5rob9wrTq2qmb04fnkLXv4NpiQ8wHgmBhdQ=; b=uSMNsWNDtZAxifOBhv6UdFoU77ISvgEyW4xfG/QQBUdP0vLxGtUMQFjR1H/4yLKkci 8a9g81aQ8cQ26DDg4pE2zCvAPQCBLY1Mv8xgmEEWG8/FiDtbbIfJwjbVt6DsHGlyAhIb yZt2fl9qdANBlWTLe8DU4TC1STGYneY8P1EFp+VfHas/q+7uJWEgyOkiYDy0rab1Z8cy UpTA6eGVjCfwod9yncj70h63KC3gAifHzDyjzhiWcT0Lz/C3+f+a8f0bvrnwps4XWKJe J6IROnXqwGMqmIsoJOZ0cPbRqjz1YDXtk+1grvpVWbdJ0S64qM9IzTprZHClvm8zp/Kw AfFQ== X-Gm-Message-State: APjAAAWLusAsaR/Ob/rKS7V9luK8O6NmyLkydjNtjry/y8jiEK+eomRr 3jklzHwDz9jAPl9Nm73vnwbac4vM X-Google-Smtp-Source: APXvYqysG9Euycb7WM82W/Td0I147yU5XTejtd+bqGoAlGKBmm3Qvmlpmn7SqAtCcQzqSKytc+nEPw== X-Received: by 2002:ac8:59:: with SMTP id i25mr76889454qtg.110.1578335095624; Mon, 06 Jan 2020 10:24:55 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:24:55 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 02/59] ppc440_bamboo.c: remove label from bamboo_load_device_tree() Date: Mon, 6 Jan 2020 15:23:28 -0300 Message-Id: <20200106182425.20312-3-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label can be replaced by 'return -1' in all cases. CC: David Gibson CC: qemu-ppc@nongnu.org Signed-off-by: Daniel Henrique Barboza --- hw/ppc/ppc440_bamboo.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index 4d95c0f8a8..b782641b23 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -71,12 +71,12 @@ static int bamboo_load_device_tree(hwaddr addr, filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE); if (!filename) { - goto out; + return -1; } fdt = load_device_tree(filename, &fdt_size); g_free(filename); if (fdt == NULL) { - goto out; + return -1; } /* Manipulate device tree in memory. */ @@ -117,10 +117,6 @@ static int bamboo_load_device_tree(hwaddr addr, rom_add_blob_fixed(BINARY_DEVICE_TREE_FILE, fdt, fdt_size, addr); g_free(fdt); return 0; - -out: - - return ret; } /* Create reset TLB entries for BookE, spanning the 32bit addr space. */ From patchwork Mon Jan 6 18:23:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218340 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fvEA+lPf"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s3sv10YLz9sPn for ; Tue, 7 Jan 2020 05:28:19 +1100 (AEDT) Received: from localhost ([::1]:57686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX6u-0005jX-JX for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:28:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44995) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3j-0001Qt-8P for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3i-0003gd-1j for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:24:59 -0500 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:37941) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3h-0003gA-T6; Mon, 06 Jan 2020 13:24:57 -0500 Received: by mail-qv1-xf43.google.com with SMTP id t6so19445797qvs.5; Mon, 06 Jan 2020 10:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w1daSF8Ke50vf7L1lkiX0k78v3ttDXfxEHmXKjiAnDM=; b=fvEA+lPfmF5uzZTGgJKwCrnrb0+IU9t4oJ74GmQhGsUw8ayTq0kCoiOsWnTHyXEZzA HM02mY9S0Ppzbk6pg5VFW3FBLfI9LN+Y9vf8OT/Upj5c2TgmYOeeCwGWrdCE2z+ubUSW HbLFak51A2jvycRPrk+GJ9ilsqbhQMMLS4/mwtjlrlW5D7hHtf5PlWbZC99MEcePiCLN NK5FjV+21LTBZSBcF+o0niXd7C4nHn7lvM5KXfrpUaQlPBV2PlRoQQdjzzNlj4rjq7lA R6Lunp1SY/5fUqYyvqeVV4fbvbu36wQxWATOw4FZmoPt/fsD7N/lVN+0yYAV964e8QUU zosQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w1daSF8Ke50vf7L1lkiX0k78v3ttDXfxEHmXKjiAnDM=; b=hU99zO16K70HC2No3uyBaNfwHehSnfivFPakkJieQOanjUPZvRptHs2R6E5yaJ25Iu nEeE8mKKnz3AzxVZUniLwGF2C2T1D4s4YneMKflPjPA34wC6FyaK+ADKLT560tPPZgO7 +W2xRHI/qzKxqTXAp5ROyVGjwNG/TJUe5kAu4jfstgvYKtTYWfjfus+hQ+wHn++rwWWV yVL7hzoDuqyp8le7DZ/VroBFmP9zycAmSZXZViN9+r+8NrWy4x4J1Py3xjcAioRkA33C 9c5WGadZui8uQSY6HE2BmUVVCFpBH1+W3BNvDXC2dTBMJf4oBH1P9j8PqzQwEYx1ukKH xnPA== X-Gm-Message-State: APjAAAVLm8ORWIExG6w4YjuZvmrO/Ibvq5YrJ6dm7oClefTpjZVy3Tzi ejmmfQzJNFIRHZ9lhypyjHo428d3 X-Google-Smtp-Source: APXvYqxWTlBIt1KcA9as9yiBJamQ7BhAdA9fJnTkcj1X7G95+rr5BfkNXkOu4UuKsXjqGexd6u42yg== X-Received: by 2002:a0c:8605:: with SMTP id p5mr80154235qva.109.1578335097141; Mon, 06 Jan 2020 10:24:57 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:24:56 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 03/59] kvm-all.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:23:29 -0300 Message-Id: <20200106182425.20312-4-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f43 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Paolo Bonzini , Daniel Henrique Barboza Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Labels 'err' and 'out' from kvm_destroy_vcpu(), kvm_init_vcpu() and kvm_physical_sync_dirty_bitmap() can be replaced by 'return' with the appropriate return value. CC: Paolo Bonzini Signed-off-by: Daniel Henrique Barboza --- accel/kvm/kvm-all.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index b2f1a5bcb5..09ca99e082 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -329,26 +329,24 @@ int kvm_destroy_vcpu(CPUState *cpu) ret = kvm_arch_destroy_vcpu(cpu); if (ret < 0) { - goto err; + return ret; } mmap_size = kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0); if (mmap_size < 0) { - ret = mmap_size; DPRINTF("KVM_GET_VCPU_MMAP_SIZE failed\n"); - goto err; + return mmap_size; } ret = munmap(cpu->kvm_run, mmap_size); if (ret < 0) { - goto err; + return ret; } vcpu = g_malloc0(sizeof(*vcpu)); vcpu->vcpu_id = kvm_arch_vcpu_id(cpu); vcpu->kvm_fd = cpu->kvm_fd; QLIST_INSERT_HEAD(&kvm_state->kvm_parked_vcpus, vcpu, node); -err: return ret; } @@ -381,7 +379,7 @@ int kvm_init_vcpu(CPUState *cpu) ret = kvm_get_vcpu(s, kvm_arch_vcpu_id(cpu)); if (ret < 0) { DPRINTF("kvm_create_vcpu failed\n"); - goto err; + return ret; } cpu->kvm_fd = ret; @@ -390,17 +388,15 @@ int kvm_init_vcpu(CPUState *cpu) mmap_size = kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0); if (mmap_size < 0) { - ret = mmap_size; DPRINTF("KVM_GET_VCPU_MMAP_SIZE failed\n"); - goto err; + return mmap_size; } cpu->kvm_run = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE, MAP_SHARED, cpu->kvm_fd, 0); if (cpu->kvm_run == MAP_FAILED) { - ret = -errno; DPRINTF("mmap'ing vcpu state failed\n"); - goto err; + return -errno; } if (s->coalesced_mmio && !s->coalesced_mmio_ring) { @@ -408,9 +404,7 @@ int kvm_init_vcpu(CPUState *cpu) (void *)cpu->kvm_run + s->coalesced_mmio * PAGE_SIZE; } - ret = kvm_arch_init_vcpu(cpu); -err: - return ret; + return kvm_arch_init_vcpu(cpu); } /* @@ -565,7 +559,6 @@ static int kvm_physical_sync_dirty_bitmap(KVMMemoryListener *kml, KVMSlot *mem; hwaddr start_addr, size; hwaddr slot_size, slot_offset = 0; - int ret = 0; size = kvm_align_section(section, &start_addr); while (size) { @@ -575,7 +568,7 @@ static int kvm_physical_sync_dirty_bitmap(KVMMemoryListener *kml, mem = kvm_lookup_matching_slot(kml, start_addr, slot_size); if (!mem) { /* We don't have a slot if we want to trap every access. */ - goto out; + return 0; } if (!mem->dirty_bmap) { @@ -587,8 +580,7 @@ static int kvm_physical_sync_dirty_bitmap(KVMMemoryListener *kml, d.slot = mem->slot | (kml->as_id << 16); if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) { DPRINTF("ioctl failed %d\n", errno); - ret = -1; - goto out; + return -1; } subsection.offset_within_region += slot_offset; @@ -599,8 +591,8 @@ static int kvm_physical_sync_dirty_bitmap(KVMMemoryListener *kml, start_addr += slot_size; size -= slot_size; } -out: - return ret; + + return 0; } /* Alignment requirement for KVM_CLEAR_DIRTY_LOG - 64 pages */ From patchwork Mon Jan 6 18:23:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218341 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tzBvyGj+"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s3tK5MwCz9sPn for ; Tue, 7 Jan 2020 05:28:41 +1100 (AEDT) Received: from localhost ([::1]:57692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX7H-0006FC-5Q for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:28:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45029) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3k-0001TD-LO for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3j-0003iA-Li for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:00 -0500 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]:43832) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3j-0003ho-Hv; Mon, 06 Jan 2020 13:24:59 -0500 Received: by mail-qv1-xf34.google.com with SMTP id p2so19406856qvo.10; Mon, 06 Jan 2020 10:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=b3ezhmI6tKSWqDJ/WfwsteLWfxOpOCrsFHh/gbYbAF0=; b=tzBvyGj+wo2T2PolIlgntJfnn2j0wmFIzjfVA/xfbb6SHdEOj3ECGjiDut4B2xfRUx HvfWVudIb33UJYVpg64NVRCAF90YRNV59v/jWQ1BvCig2z2ObX0JQzfK/zpBhdjzU+E3 IvbB5oOLuvl9rUo+OHQTWip3yVc44k7Hs5AKXtOIQkNBzFPKD4Xt/PEYT0iBGPJxPpVF 6x8lz/kRro2g5UIqTVg87FoAJ+EGGk301p/uPY6NV9w31M3hBgbcutVG2/fUra3E+23Z BuFkuj/XsU4YjvjNKGl4RDTX49CxhILyGAp+KyveD+J+XAburCq05wAMAtMBlGzVI8Qg u2Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=b3ezhmI6tKSWqDJ/WfwsteLWfxOpOCrsFHh/gbYbAF0=; b=t10rjgl4vNYfAbqRkzoSThgUeWQcmYPBK7ZhYzb+qjdU5BUVOwX8plv25XxwomPpos zoKUt/MEAqfFNTYuyoKdeNWGtMCy4DOocPuNlQCpdjzGL1SF/Q9vhMMA7Jt5L2Qv8pm8 /3fe3EE0Me3NFpHuaF7YZ2Tb6KWYyA7GqG7fIOCPYyneJVqs/Hi58uQ36uwtAGLk9EAT wnbSzXTI+kHgAE1Wz3hqQak1m+Jeoa5DpZpDBEluB9O3EdAilNPrTy5cuhuP16qpC02C my30IKNw/6KNtrozVTnDApayQBQTTRmGjAqUSeEaSYntml9+FA++QAFyN+6ka6Yg8g/Z z0rg== X-Gm-Message-State: APjAAAU7lG0pGGMeSSopkQ3HYceD6UngohKWTnC9TUQ9aForHyfM0lz8 ycJZ248i3uJN52Hv2uDzPgB8eroU X-Google-Smtp-Source: APXvYqxa8alPkC2npZOI2FQeAkrumgVeX/miC9HIetSqUniM1Jt1AOLEdKApQV2OAJgr2qzoUR3JLA== X-Received: by 2002:ad4:58e1:: with SMTP id di1mr65547720qvb.201.1578335098883; Mon, 06 Jan 2020 10:24:58 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:24:58 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 04/59] paaudio.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:23:30 -0300 Message-Id: <20200106182425.20312-5-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f34 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Label 'fail1' in qpa_init_out() and qpa_init_in() can be replaced by 'return -1'. CC: Gerd Hoffmann Signed-off-by: Daniel Henrique Barboza --- audio/paaudio.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/audio/paaudio.c b/audio/paaudio.c index 55a91f8980..8f42b2079c 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -470,7 +470,7 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsettings *as, ); if (!pa->stream) { qpa_logerr (error, "pa_simple_new for playback failed\n"); - goto fail1; + return -1; } audio_pcm_init_info (&hw->info, &obt_as); @@ -479,9 +479,6 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsettings *as, &obt_as, ppdo->buffer_length); return 0; - - fail1: - return -1; } static int qpa_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque) @@ -518,7 +515,7 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque) ); if (!pa->stream) { qpa_logerr (error, "pa_simple_new for capture failed\n"); - goto fail1; + return -1; } audio_pcm_init_info (&hw->info, &obt_as); @@ -527,9 +524,6 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque) &obt_as, ppdo->buffer_length); return 0; - - fail1: - return -1; } static void qpa_simple_disconnect(PAConnection *c, pa_stream *stream) From patchwork Mon Jan 6 18:23:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218345 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PVL37wwi"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s3yt3gCbz9sPK for ; Tue, 7 Jan 2020 05:32:38 +1100 (AEDT) Received: from localhost ([::1]:57756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXB5-00026o-EI for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:32:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45071) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3m-0001Wn-Pg for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3l-0003k5-II for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:02 -0500 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:43225) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3l-0003ja-Dv; Mon, 06 Jan 2020 13:25:01 -0500 Received: by mail-qv1-xf44.google.com with SMTP id p2so19406901qvo.10; Mon, 06 Jan 2020 10:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OpEeHG8VMYN/6kN5WjiHoFM09NjO3owbEnQZsuwufHY=; b=PVL37wwiLOZ/UhuxFDC6beTK3Lf9R834ZgZAJYqeOvLynH3sjlel0frLEvPiLVMTmv I/LeOBkD+Jgo2zHjiy9iMnfjAhX8rUE4e5MkM+02ieHu/p79swltEoStKpEakIWtithb RLqm0qkwBazQJZqH5SvwSM6UPV2Czq1U2HMhiF1MYNHT/dycOZ2Gu7HwL/6KDrS31EOR cqIwXOIXp4213MdwhaJDWaR3Ez3ScBDYzOWCAV0E0Nmw9Ys8ioCzdE2MqzEdoz/PO0/D Kt5n37l/WDj1fOJSj1qWPLfy7x3mK/0BeKZwlJMiRkDjEexJZzA/7hdNh24BpxWxtdVx baJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OpEeHG8VMYN/6kN5WjiHoFM09NjO3owbEnQZsuwufHY=; b=Z76ocpTOYCsz2a7ELql8+jIoj2DeQTVdOR+EE1zhMDCocqyi7UW2mxk+e6WffEspmN grj81z9MwLqJyN9ts+KDLPEz1OegjHxCAd1NALjw9b/VrGRAt1n0JYy2AP6v2KE7Wv2+ cCAHNXmAEyyEopdvOfIBTRb7I5eQ+EmupBj1DzmJg9CAk4fYk805g0BEJU2EcMad1ijg tajMqlaS8K9iSk14IFTN6r3ZvUtGhR2oc5OSWQ24ajdXXRGPkNYhTEHKUtFH0qibiv1u R5d7h8DfszDimvNKFs0J/kUiWwtJ1WKgqmrXtxC0NuYQNCYc2YMhStpnTQDdkYXlRmvg 4ZsA== X-Gm-Message-State: APjAAAWXPpbO+Qh3PJWgx/sOCQgmoiszTs4h4eR90Mbg1awFVIVw5wfH RsUrUG7gB2I9FlVP2R7UVdUnl7O1 X-Google-Smtp-Source: APXvYqyfpYF68ZJGI74BOh433meVATIdOibL9LaFAPigjDejL8zyFx4rLNAADJRr2vi1oN7ik2OHog== X-Received: by 2002:a0c:f6cd:: with SMTP id d13mr78946792qvo.20.1578335100652; Mon, 06 Jan 2020 10:25:00 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:00 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 05/59] ram.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:23:31 -0300 Message-Id: <20200106182425.20312-6-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , "Dr . David Alan Gilbert" , Juan Quintela Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" ram_save_queue_pages() has an 'err' label that can be replaced by 'return -1' instead. Same thing with ram_discard_range(), and in this case we can also get rid of the 'ret' variable and return either '-1' on error or the result of ram_block_discard_range(). CC: Juan Quintela CC: Dr. David Alan Gilbert Signed-off-by: Daniel Henrique Barboza Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Juan Quintela --- migration/ram.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/migration/ram.c b/migration/ram.c index 96feb4062c..980cc644d7 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2434,7 +2434,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len) * it's the 1st request. */ error_report("ram_save_queue_pages no previous block"); - goto err; + return -1; } } else { ramblock = qemu_ram_block_by_name(rbname); @@ -2442,7 +2442,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len) if (!ramblock) { /* We shouldn't be asked for a non-existent RAMBlock */ error_report("ram_save_queue_pages no block '%s'", rbname); - goto err; + return -1; } rs->last_req_rb = ramblock; } @@ -2451,7 +2451,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len) error_report("%s request overrun start=" RAM_ADDR_FMT " len=" RAM_ADDR_FMT " blocklen=" RAM_ADDR_FMT, __func__, start, len, ramblock->used_length); - goto err; + return -1; } struct RAMSrcPageRequest *new_entry = @@ -2467,9 +2467,6 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len) qemu_mutex_unlock(&rs->src_page_req_mutex); return 0; - -err: - return -1; } static bool save_page_use_compression(RAMState *rs) @@ -3072,8 +3069,6 @@ int ram_postcopy_send_discard_bitmap(MigrationState *ms) */ int ram_discard_range(const char *rbname, uint64_t start, size_t length) { - int ret = -1; - trace_ram_discard_range(rbname, start, length); RCU_READ_LOCK_GUARD(); @@ -3081,7 +3076,7 @@ int ram_discard_range(const char *rbname, uint64_t start, size_t length) if (!rb) { error_report("ram_discard_range: Failed to find block '%s'", rbname); - goto err; + return -1; } /* @@ -3093,10 +3088,7 @@ int ram_discard_range(const char *rbname, uint64_t start, size_t length) length >> qemu_target_page_bits()); } - ret = ram_block_discard_range(rb, start, length); - -err: - return ret; + return ram_block_discard_range(rb, start, length); } /* From patchwork Mon Jan 6 18:23:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218343 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BBNdStsn"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s3vn0TDjz9s29 for ; Tue, 7 Jan 2020 05:29:57 +1100 (AEDT) Received: from localhost ([::1]:57706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX8U-0007VW-FH for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:29:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45109) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3q-0001dU-4Y for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3n-0003lu-LE for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:05 -0500 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:42538) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3n-0003lV-Eo; Mon, 06 Jan 2020 13:25:03 -0500 Received: by mail-qk1-x741.google.com with SMTP id z14so39012652qkg.9; Mon, 06 Jan 2020 10:25:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6Myf4ZWmr4nE4JAJE8+rypGdemGPMt6KifqXfy2qX4M=; b=BBNdStsnR86XbL41pOc8DijV7GPqR46FvkotpzYm449GLuY7kU1qnOn0nKQiNf1uvS DhUxUGtVM0M7J5op78fqT8N66vKJR2dQODcEHb31rzpxoUBCbP0eqq0P97ghSs5rCG7R XUGg4r4ldA8QUDUJ7zj2cAWLfC1SE+JHNykcEDL7F1Yi0m4C+63MS2E4V4G0U9IW7Vqk hoW9YyZIA7MkYzdCu2aME/rI8JTLIyK+0tdxBstBg7ZkcGmxMhMW0rkkJCSjFNfx76jh KbzqHKCTNmzkDqxt7pIfBxSR36Gg/D0G/c2KYZJnI6PeAPIcdpufi18OidMBs+TEOtlS jthA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6Myf4ZWmr4nE4JAJE8+rypGdemGPMt6KifqXfy2qX4M=; b=g1J1FdUFOJ4ogP6SbSAgBjHHIDbRUVKNEZi+YKg+WF4gQOPn8Eozdx2FixaQe06Afl uKgOZSbL2Gl3DrQc9uSmboz/4BnLIfTOdIZTt1SIkpl2Y9IDnOtkCl91XwoYEWPU3GK8 Es5pvbKRU1XmgeQLK+MMP8GnD8Kpde6et5y5czCtSoyEZpzh0vqbJvJDbPFHGzDEsMAk T2qMySwWUXP03BLmn+FiPWsx0Ix/VxnqYpPR0vtV2W9bR+PNr+Qa4mkMS3RFFs8vnu5E JeFeE3947L+ZWF7DHh6oJJH68v0U8c9pRMmMnM9tbNMMcxxjaRkOo1RcmALtHnIUc5P9 NSHA== X-Gm-Message-State: APjAAAUh+lPw18YDJg4HTRNtthXgOWWE/R4IK8Af9xpIcHBXxbGy490Z lvOxl3tMUk+pVt2m7mSlaH4znWqP X-Google-Smtp-Source: APXvYqy+sEo/5P9jgzxK2PvQhLOP0hE9C4PXCbzbNZ+mUJ+LarIsGOdiT0jcUwA2uNynUVAd7dPVaA== X-Received: by 2002:a37:a54b:: with SMTP id o72mr83397639qke.313.1578335102807; Mon, 06 Jan 2020 10:25:02 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:02 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 06/59] mips-semi.c: remove 'uhi_done' label in helper_do_semihosting() Date: Mon, 6 Jan 2020 15:23:32 -0300 Message-Id: <20200106182425.20312-7-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Aleksandar Rikalo , Daniel Henrique Barboza , Aleksandar Markovic , Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The label 'uhi_done' is a simple 'return' call and can be removed for a bit more clarity in the code. CC: Aurelien Jarno CC: Aleksandar Markovic CC: Aleksandar Rikalo Signed-off-by: Daniel Henrique Barboza Reviewed-by: Aleksandar Markovic --- target/mips/mips-semi.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/target/mips/mips-semi.c b/target/mips/mips-semi.c index 35bdfd7c77..10a710c1e8 100644 --- a/target/mips/mips-semi.c +++ b/target/mips/mips-semi.c @@ -218,7 +218,7 @@ static int copy_argn_to_target(CPUMIPSState *env, int arg_num, if (!p) { \ gpr[2] = -1; \ gpr[3] = EFAULT; \ - goto uhi_done; \ + return; \ } \ } while (0) @@ -228,14 +228,14 @@ static int copy_argn_to_target(CPUMIPSState *env, int arg_num, if (!p) { \ gpr[2] = -1; \ gpr[3] = EFAULT; \ - goto uhi_done; \ + return; \ } \ p2 = lock_user_string(addr2); \ if (!p2) { \ unlock_user(p, addr, 0); \ gpr[2] = -1; \ gpr[3] = EFAULT; \ - goto uhi_done; \ + return; \ } \ } while (0) @@ -272,7 +272,7 @@ void helper_do_semihosting(CPUMIPSState *env) if (gpr[4] < 3) { /* ignore closing stdin/stdout/stderr */ gpr[2] = 0; - goto uhi_done; + return; } gpr[2] = close(gpr[4]); gpr[3] = errno_mips(errno); @@ -302,7 +302,7 @@ void helper_do_semihosting(CPUMIPSState *env) gpr[2] = fstat(gpr[4], &sbuf); gpr[3] = errno_mips(errno); if (gpr[2]) { - goto uhi_done; + return; } gpr[2] = copy_stat_to_target(env, &sbuf, gpr[5]); gpr[3] = errno_mips(errno); @@ -314,14 +314,14 @@ void helper_do_semihosting(CPUMIPSState *env) case UHI_argnlen: if (gpr[4] >= semihosting_get_argc()) { gpr[2] = -1; - goto uhi_done; + return; } gpr[2] = strlen(semihosting_get_arg(gpr[4])); break; case UHI_argn: if (gpr[4] >= semihosting_get_argc()) { gpr[2] = -1; - goto uhi_done; + return; } gpr[2] = copy_argn_to_target(env, gpr[4], gpr[5]); break; @@ -369,6 +369,5 @@ void helper_do_semihosting(CPUMIPSState *env) fprintf(stderr, "Unknown UHI operation %d\n", op); abort(); } -uhi_done: return; } From patchwork Mon Jan 6 18:23:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218344 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ir10aGHi"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s3xk4v3Tz9s29 for ; Tue, 7 Jan 2020 05:31:38 +1100 (AEDT) Received: from localhost ([::1]:57748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXA7-00018V-To for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:31:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45119) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3q-0001el-Nh for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3p-0003nI-87 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:06 -0500 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:33219) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3p-0003n4-3a; Mon, 06 Jan 2020 13:25:05 -0500 Received: by mail-qv1-xf43.google.com with SMTP id z3so19445708qvn.0; Mon, 06 Jan 2020 10:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eY6GwOKUsSxbSiC0sEZUPgTqkPSXyaF2//XptsTcqg0=; b=Ir10aGHisUato561BZTbYR+T9sXZkJZa09fi7GWiq733xHdB0qdupgf6KGp2/jlp72 9liT2tk+YwLFfMuybNo72GaPvgAK70rwojOb2rBHSiLquEVIYZ404wx8/NWW9Kj0qMR1 DkyB9UexOsa5+H11jhW4kYgvjimYr2O9EYdfEQp2bM3W08jAJgnF21yC3x/SEqTARsi7 3Xor9+ML05wbwttIZSIZ6OIdKpEnX7HFyFSBcTDx+plwF4R4apt8Jg+hVXUEt5zQVhq9 LGYTVvXLm8YRjrCa1ksHW9676g+sv59z+e1W/3g9YjAKVd6nwkoAcB0JCMRAkyeaAy3i exeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eY6GwOKUsSxbSiC0sEZUPgTqkPSXyaF2//XptsTcqg0=; b=nV9P8rFlBwJ0JUrVPa4mfcKB+RnysB5oon7rRGKRL+5ggkboCqFCZJVwmnj/yaMjnV wCjjaZJymlOZaDUc9Qeagf5qhDg1Yk+eB1jULDw4n29ZEgaT1ugqB/qCKp82PqjnbvYd gHMdHjFlXXd1l5gbaW+/XwOhCFDnCOT5VXxpidQkY31St5ZBWY4Me2O0meVSBpJULSXo eOkrJ9RipyiQmBL0bbO4QtYRyoydNZo/SU8CopQ+rhsaatQKzIb/kPW98wXzmiQjr033 QWAYXS76+6lbq8uLPtdBVwLQb7UyjyEf+Z4tlW6kusC3v0Pw9Y87i/n5aENTkYdKOUFP q7YQ== X-Gm-Message-State: APjAAAW4xq10+H7O0mlandP7wwrjiozRI5q8vhY41fCz4Dsj+ztpKnUT oeoLpSZNOErDYLwPEMlJCGGjXsXo X-Google-Smtp-Source: APXvYqy1QFUQeLXKMDt2TJuYG88b704qBzioKoASnhKiJguwt1zbK+ohgbdq9BwNC8spt6Uq6hNRDw== X-Received: by 2002:a0c:c542:: with SMTP id y2mr6110998qvi.225.1578335104537; Mon, 06 Jan 2020 10:25:04 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:04 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 07/59] unicore32/softmmu.c: remove 'do_fault' label in get_phys_addr_ucv2() Date: Mon, 6 Jan 2020 15:23:33 -0300 Message-Id: <20200106182425.20312-8-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f43 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Guan Xuetao Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'do_fault' is a label that executes 'return code'. The 'code' variable is an integer that is set to zero, then in all instances it is set to another value right before 'do_fault'. We can get rid of both the label and the variable to make the code a bit cleaner. CC: Guan Xuetao Signed-off-by: Daniel Henrique Barboza --- target/unicore32/softmmu.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/target/unicore32/softmmu.c b/target/unicore32/softmmu.c index cbdaa500b7..3373400cba 100644 --- a/target/unicore32/softmmu.c +++ b/target/unicore32/softmmu.c @@ -125,7 +125,6 @@ static int get_phys_addr_ucv2(CPUUniCore32State *env, uint32_t address, target_ulong *page_size) { CPUState *cs = env_cpu(env); - int code; uint32_t table; uint32_t desc; uint32_t phys_addr; @@ -135,13 +134,11 @@ static int get_phys_addr_ucv2(CPUUniCore32State *env, uint32_t address, table = env->cp0.c2_base & 0xfffff000; table |= (address >> 20) & 0xffc; desc = ldl_phys(cs->as, table); - code = 0; switch (PAGETABLE_TYPE(desc)) { case 3: /* Superpage */ if (!(desc & UC32_PAGETABLE_EXIST)) { - code = 0x0b; /* superpage miss */ - goto do_fault; + return 0x0b; /* superpage miss */ } phys_addr = (desc & 0xffc00000) | (address & 0x003fffff); *page_size = SUPERPAGE_SIZE; @@ -152,8 +149,7 @@ static int get_phys_addr_ucv2(CPUUniCore32State *env, uint32_t address, DPRINTF("PGD address %x, desc %x\n", table, desc); } if (!(desc & UC32_PAGETABLE_EXIST)) { - code = 0x05; /* second pagetable miss */ - goto do_fault; + return 0x05; /* second pagetable miss */ } table = (desc & 0xfffff000) | ((address >> 10) & 0xffc); desc = ldl_phys(cs->as, table); @@ -162,8 +158,7 @@ static int get_phys_addr_ucv2(CPUUniCore32State *env, uint32_t address, DPRINTF("PTE address %x, desc %x\n", table, desc); } if (!(desc & UC32_PAGETABLE_EXIST)) { - code = 0x08; /* page miss */ - goto do_fault; + return 0x08; /* page miss */ } switch (PAGETABLE_TYPE(desc)) { case 0: @@ -185,8 +180,7 @@ static int get_phys_addr_ucv2(CPUUniCore32State *env, uint32_t address, *prot |= PAGE_READ; } else { if (is_user && (access_type == 0)) { - code = 0x11; /* access unreadable area */ - goto do_fault; + return 0x11; /* access unreadable area */ } } @@ -194,8 +188,7 @@ static int get_phys_addr_ucv2(CPUUniCore32State *env, uint32_t address, *prot |= PAGE_WRITE; } else { if (is_user && (access_type == 1)) { - code = 0x12; /* access unwritable area */ - goto do_fault; + return 0x12; /* access unwritable area */ } } @@ -203,13 +196,11 @@ static int get_phys_addr_ucv2(CPUUniCore32State *env, uint32_t address, *prot |= PAGE_EXEC; } else { if (is_user && (access_type == 2)) { - code = 0x13; /* access unexecutable area */ - goto do_fault; + return 0x13; /* access unexecutable area */ } } -do_fault: - return code; + return 0; } bool uc32_cpu_tlb_fill(CPUState *cs, vaddr address, int size, From patchwork Mon Jan 6 18:23:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218348 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qsvA6ykM"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s41d3t21z9sPn for ; Tue, 7 Jan 2020 05:35:01 +1100 (AEDT) Received: from localhost ([::1]:57788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXDO-0004xU-Oq for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:34:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45152) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3s-0001h1-Am for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3r-0003r6-7p for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:08 -0500 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:41657) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3r-0003qn-3c; Mon, 06 Jan 2020 13:25:07 -0500 Received: by mail-qv1-xf44.google.com with SMTP id x1so19419533qvr.8; Mon, 06 Jan 2020 10:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HIopQr4qTmGaxGQiMN5TTFQQCD/j0A0k1KsTz1BsHzQ=; b=qsvA6ykMdsUaYwrycIaSnBHwNEA/UnDxc/XsRoNQAUOHMpjXlpz7Q5dMJQpV8uzJvi wHjeM/Fld3r94sYQ0FRIw9ABv2y6VXn3Zjwn9rHPiP9Tk4YFC3Yuu0LjgA6/niZyCfzi utUJ0T29pW/0DLN5pF1ZhaZ8qZPfFMb9PDB5Q6AyZ22Hd2hohPUTWM8yn8qV/8qDonXk RIOp7cpQjxV/BFtef6J5EcPXW275Vh4EKw88y1C9P1j+Mz6Tm7jms9c61gl9v2CrY1UH wG/i6cgvxYUNHyIYEcea6+rnz4ja9X8a6pXOiDTlem5jvnyTkroi2ONCdKuAfyJDBgzk aKnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HIopQr4qTmGaxGQiMN5TTFQQCD/j0A0k1KsTz1BsHzQ=; b=J5FjlitYmGodnWImDiELQCsMA7v22xY45FQg6Md9yFaeiHmLAWP9UHAn0+X1muyvDb MalDFpdzfhzVvCfzD/9ZIo10K4AZXGhvk4O+nrNM0SbSCOog60YCQDWgAq37EwZwjdw1 kL5BinS92qn3Iuwk9A0FxuW+oNZ/LrT2OvZFWiMukC3V6gIt23Ha/gX4Vx0n8WSDNkhq 37kkO+GazFUfnqj/aqfpLtbrzWz8IH4j6evlBEOJpInU/D6YsxTvm3YPDuqfEq1zD1oa DkdQ27uyeYynY3941EvWZyVSZuKKEC0Ms/XDhf/462euaFCibBN5ga/v6CidjAkHjrjS nQsw== X-Gm-Message-State: APjAAAX+jb3xBNPQQiwtRbfSM+zaw+0VQAjbxtaArRyFTs9wxAiOZTUK fYtmPljaoY8GtPLznw4fRDJvYFBu X-Google-Smtp-Source: APXvYqyrGoztyJ3OW0uHkXVUIYehSLXql54psfC/wxm3VKSe1+tGwfTPA0tiSR1qnkYmgtNRym0H0A== X-Received: by 2002:ad4:49cc:: with SMTP id j12mr79841188qvy.188.1578335106538; Mon, 06 Jan 2020 10:25:06 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:06 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 08/59] chardev/char-mux.c: remove 'send_char' label Date: Mon, 6 Jan 2020 15:23:34 -0300 Message-Id: <20200106182425.20312-9-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Daniel Henrique Barboza , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" CC: Marc-AndrĂ© Lureau CC: Paolo Bonzini Signed-off-by: Daniel Henrique Barboza Reviewed-by: Marc-AndrĂ© Lureau --- chardev/char-mux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chardev/char-mux.c b/chardev/char-mux.c index 200c62a0d0..edbaaf5cbf 100644 --- a/chardev/char-mux.c +++ b/chardev/char-mux.c @@ -140,7 +140,7 @@ static int mux_proc_byte(Chardev *chr, MuxChardev *d, int ch) if (d->term_got_escape) { d->term_got_escape = 0; if (ch == term_escape_char) { - goto send_char; + return 1; } switch (ch) { case '?': @@ -174,7 +174,6 @@ static int mux_proc_byte(Chardev *chr, MuxChardev *d, int ch) } else if (ch == term_escape_char) { d->term_got_escape = 1; } else { - send_char: return 1; } return 0; From patchwork Mon Jan 6 18:23:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218338 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oW0fJ1WO"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s3rN6YM3z9s29 for ; Tue, 7 Jan 2020 05:26:59 +1100 (AEDT) Received: from localhost ([::1]:57672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX5b-0003Ka-Db for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:26:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45189) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3u-0001ju-Do for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3t-0003t3-2H for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:10 -0500 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:33722) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3s-0003sS-Tj; Mon, 06 Jan 2020 13:25:08 -0500 Received: by mail-qt1-x844.google.com with SMTP id d5so43221896qto.0; Mon, 06 Jan 2020 10:25:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QRyshu9MeZF7Qp8JBN9b2R4zIWlvD97XdczFgR/WKsg=; b=oW0fJ1WOFaFYQygb4OiaE2zwvUJCoVB0ClpJiA+CpxlH5uLM/ELeanPSZao/ebTUai azFcEXAXgGk5jMU6ksXGrZdoPcQ7w+4hCy2+fnwl7yemAoThA+FTuV2H76J8EfNxVIRx /C0gbSFOtqmy8udAeWsKYRouWWF621uQ3Ba+UvCnqmyAtgNZPIBh2vHvIrUhMYw7lOUu OSVobWtjOKsj1P+sEc3HZnfUVOapduplG09t3LZRFjUJW3vFzx0mXqYne9VFRn9/CobG 7I1LlNZmPfpqCl7bGc4sbNINlk2ofK073OgQ4UwM7L7CV5l22HT8RRfv6DcFaNgieVPJ +b1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QRyshu9MeZF7Qp8JBN9b2R4zIWlvD97XdczFgR/WKsg=; b=Q24w6nMclxdp/QCYJMqeN8VFoj2fJe5yV4n1L6YiCqsQk1oHxZlOX7d2za6oIKxyg/ /Q/wfKcwxaMDbb+ZzZc6EC/MO878IXIxW7vF49CbvuLcdoznOyICB9ecbuTxkQhEiMxI kJfg2XgWsQ53JFHPu9R4a5RzJYJSKB7z7/Bzrlkqe7UI9gNbrhg50Ngg/OIUsGH1bpGE TAjHbJnL31WZ6F1t2FUTfEq0C9FFx/sPcg0kgkG+g1PmEASIW6lxHyWj94FghDi+KR7k euGDLaJr+QJBiifeff+rAfrLpzzZXnF14xdx1tuLJYqyJ+FZF5fgAevpOE36d/M0pqd/ QKRQ== X-Gm-Message-State: APjAAAWvf2hnMXOsX76Z0kH2CSYsN3Krgmfg5XWZnc3eK4Oh6F6CZIbi KSql+Ywyu0geqT6tKbtlAs4ZeGZq X-Google-Smtp-Source: APXvYqz2P1iO6OVNn84mm/5qlWhQzA+cG1IKA4KYCAetSls150BfSZkRNfZfWLTnxF9hsQgqLWY5PQ== X-Received: by 2002:ac8:41c1:: with SMTP id o1mr61453222qtm.229.1578335108258; Mon, 06 Jan 2020 10:25:08 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:07 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 09/59] chardev/char-pipe.c: remove 'fail' label in win_chr_pipe_init() Date: Mon, 6 Jan 2020 15:23:35 -0300 Message-Id: <20200106182425.20312-10-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Daniel Henrique Barboza , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The 'fail' label is simply doing a 'return -1'. CC: Marc-AndrĂ© Lureau CC: Paolo Bonzini Signed-off-by: Daniel Henrique Barboza Reviewed-by: Marc-AndrĂ© Lureau --- chardev/char-pipe.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/chardev/char-pipe.c b/chardev/char-pipe.c index 94d714ffcd..65d52beb0d 100644 --- a/chardev/char-pipe.c +++ b/chardev/char-pipe.c @@ -54,12 +54,12 @@ static int win_chr_pipe_init(Chardev *chr, const char *filename, s->hsend = CreateEvent(NULL, TRUE, FALSE, NULL); if (!s->hsend) { error_setg(errp, "Failed CreateEvent"); - goto fail; + return -1; } s->hrecv = CreateEvent(NULL, TRUE, FALSE, NULL); if (!s->hrecv) { error_setg(errp, "Failed CreateEvent"); - goto fail; + return -1; } openname = g_strdup_printf("\\\\.\\pipe\\%s", filename); @@ -72,7 +72,7 @@ static int win_chr_pipe_init(Chardev *chr, const char *filename, if (s->file == INVALID_HANDLE_VALUE) { error_setg(errp, "Failed CreateNamedPipe (%lu)", GetLastError()); s->file = NULL; - goto fail; + return -1; } ZeroMemory(&ov, sizeof(ov)); @@ -80,7 +80,7 @@ static int win_chr_pipe_init(Chardev *chr, const char *filename, ret = ConnectNamedPipe(s->file, &ov); if (ret) { error_setg(errp, "Failed ConnectNamedPipe"); - goto fail; + return -1; } ret = GetOverlappedResult(s->file, &ov, &size, TRUE); @@ -90,7 +90,7 @@ static int win_chr_pipe_init(Chardev *chr, const char *filename, CloseHandle(ov.hEvent); ov.hEvent = NULL; } - goto fail; + return -1; } if (ov.hEvent) { @@ -99,9 +99,6 @@ static int win_chr_pipe_init(Chardev *chr, const char *filename, } qemu_add_polling_cb(win_chr_pipe_poll, chr); return 0; - - fail: - return -1; } static void qemu_chr_open_pipe(Chardev *chr, From patchwork Mon Jan 6 18:23:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AG8vG7v2"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s44z3brtz9sPK for ; Tue, 7 Jan 2020 05:37:55 +1100 (AEDT) Received: from localhost ([::1]:57852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXGC-0000Wv-SI for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:37:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45211) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3v-0001lp-PO for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3u-0003uP-Fi for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:11 -0500 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:45902) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3u-0003u6-BB; Mon, 06 Jan 2020 13:25:10 -0500 Received: by mail-qt1-x844.google.com with SMTP id l12so43162498qtq.12; Mon, 06 Jan 2020 10:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tnY7QxipU1+snECgL7BBBU3+B3MZxCY/MIXbljxzDB8=; b=AG8vG7v2VGw2KzpxtIVUSix/hig/+nKsA/yE7FWR40p8AU5NhiYLJ38r7kYFhHSvYY CW8ELOWLFo8wKg0P6B/ylPd8YaLgS2lHNQgANVz1OXNV1ci2v43DrVPTk4VtUYGL5kph ZsoC7Hpxs98LZ2cj2k9Z/uyTFz36iynVok48mRkvwTY+GAmBTzc/jc859sGy6J+tTJP/ e5G9AJRwad+nCeHEbcXKFez4vkcHccibprR4FxOhP0yO0riUzEqbu3G2wL5K6mOz5ZgH x1gdasslqNGKmyxlxjK+5y9dzoNyoj2+lDtRFWLy4fe4iNjlbVcM9h2ppEdpPQFGxKAt 3a0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tnY7QxipU1+snECgL7BBBU3+B3MZxCY/MIXbljxzDB8=; b=i+xsplcdK1M4v8aoQqvaNe04Bm2m99GvJfZydoPCWcfpLDRssRxEflQxCUx1FwuWmN 6g97hlTN3xQBa/qHV7nAkTIvvlNMjoevHZHGvy2zK1a/Kpltqo3Ih4KLQoOg9UIBD+xm N1CpoKTpEEW4UoNpOjr9K+Sl52ZDzzPvfssi57h1pLcldYv5dRP7lytpDdpdC715tAjh hWBSdZ9atgER6sYebojAql1jk2n1iXYM807pUMsKStBgvIxBWrlYT0kg7HrBpnxIafPD WpvMbWv+3KeJQXG55iKQXgOCITYwvTFI3PYff6CXdTQQE6GBOMgHbwZBld3fbsxFNtX4 rnHw== X-Gm-Message-State: APjAAAXiD6horcvMPhLkrEagkm1EKlVx7SEPZ5YDfIj6C9agyyrwQ7XR 8HPS4S8bk0TShFuwdfnzrWHPqu7j X-Google-Smtp-Source: APXvYqye+lhuCh1FLVoCiYftUgeEtIrW0bNAhi7IeTTrucdmUNSCcRaHprn2BTjxc7LZh/69i7qYGQ== X-Received: by 2002:ac8:490f:: with SMTP id e15mr72867227qtq.32.1578335109804; Mon, 06 Jan 2020 10:25:09 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:09 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 10/59] chardev/char-win.c: remove 'fail' label in win_chr_serial_init() Date: Mon, 6 Jan 2020 15:23:36 -0300 Message-Id: <20200106182425.20312-11-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Daniel Henrique Barboza , Paolo Bonzini Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The 'fail' label is a simply call to 'return -1' on error. Remove it and do the return call instead. CC: Marc-AndrĂ© Lureau CC: Paolo Bonzini Signed-off-by: Daniel Henrique Barboza Reviewed-by: Marc-AndrĂ© Lureau Reviewed-by: Philippe Mathieu-DaudĂ© --- chardev/char-win.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/chardev/char-win.c b/chardev/char-win.c index 34825f683d..72c232e6d9 100644 --- a/chardev/char-win.c +++ b/chardev/char-win.c @@ -85,12 +85,12 @@ int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp) s->hsend = CreateEvent(NULL, TRUE, FALSE, NULL); if (!s->hsend) { error_setg(errp, "Failed CreateEvent"); - goto fail; + return -1; } s->hrecv = CreateEvent(NULL, TRUE, FALSE, NULL); if (!s->hrecv) { error_setg(errp, "Failed CreateEvent"); - goto fail; + return -1; } s->file = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, @@ -98,12 +98,12 @@ int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp) if (s->file == INVALID_HANDLE_VALUE) { error_setg(errp, "Failed CreateFile (%lu)", GetLastError()); s->file = NULL; - goto fail; + return -1; } if (!SetupComm(s->file, NRECVBUF, NSENDBUF)) { error_setg(errp, "Failed SetupComm"); - goto fail; + return -1; } ZeroMemory(&comcfg, sizeof(COMMCONFIG)); @@ -114,29 +114,26 @@ int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp) if (!SetCommState(s->file, &comcfg.dcb)) { error_setg(errp, "Failed SetCommState"); - goto fail; + return -1; } if (!SetCommMask(s->file, EV_ERR)) { error_setg(errp, "Failed SetCommMask"); - goto fail; + return -1; } cto.ReadIntervalTimeout = MAXDWORD; if (!SetCommTimeouts(s->file, &cto)) { error_setg(errp, "Failed SetCommTimeouts"); - goto fail; + return -1; } if (!ClearCommError(s->file, &err, &comstat)) { error_setg(errp, "Failed ClearCommError"); - goto fail; + return -1; } qemu_add_polling_cb(win_chr_serial_poll, chr); return 0; - - fail: - return -1; } int win_chr_pipe_poll(void *opaque) From patchwork Mon Jan 6 18:23:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218346 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="szZ/2NDm"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s3zp0Kg9z9sPK for ; Tue, 7 Jan 2020 05:33:26 +1100 (AEDT) Received: from localhost ([::1]:57776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXBr-0003B0-3o for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:33:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45235) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3x-0001oU-GT for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3w-0003y9-6Z for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:13 -0500 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:38153) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3w-0003wo-1v; Mon, 06 Jan 2020 13:25:12 -0500 Received: by mail-qt1-x844.google.com with SMTP id n15so43210630qtp.5; Mon, 06 Jan 2020 10:25:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wNyN4G4tLR9E8OrgeCl2UNMlP8h56Iu2NzeloDyPJKs=; b=szZ/2NDmZZkk416Jl30SXuRfce1Lb8bCbcwl4bonG515oQAqjm11G3slp7ZGoLzXi4 S+RofwQUkJkF9Qn99lzClL2uuBU4b0B2VKmQZMiquGMH4R4vAZ+54mSlroGK58IRr/8I vwVo43hVJ0ZuS8B2muoHUtiyKAWif044J3PN4tmCTYbL7fRYzYwZCyDwPOwiNuTEx4EP BroIUibWDoEnficSgeOgmkDOvAqZjqdYgTxy9ES3UXDoOxw+a1Ld5MPtB20wEJE6nsID erN6HGy2/Q6PdjQnS+N9pNcgcaF8lUyRwFHsOShIRfE1BA97gS+R4T7KXclRg6XqIoFC 1Juw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wNyN4G4tLR9E8OrgeCl2UNMlP8h56Iu2NzeloDyPJKs=; b=FOAsoopdMOPPgGWtlgaaXLWtPHQCOg6WXh1lEQ9AGN8onkjQiI7Pmv3y8fCArrVr32 zxBs5VFX9l7S6PNQAzrkehnu1OwbPYC2HTFYNaVROLcVJXJgcUCWo0AVa5pVnPJt3U1/ crhl1J+jRAQo1v2BkiXpf9hKMRsHausWVrKFn8lX9BFDQblS8KgGATisqXZcI7pGEOTW 0DMV6Okzm3gtmA9xAVepBLffyAcjta7pdSdUDIyEKK8EiC5HSoptj7CB8yC0GZJja3j8 6EhSm2B/uGQ+xnalkL0/g5BGj/MG3zTx5+4usvCIC3GQVXFuTkkgSTUIhUu3NDFf/Mqc XJAw== X-Gm-Message-State: APjAAAWVSbOrtMfs+yskP1HFUxW2GKCQKLBweCrYrh1hVHsM07/qCgXz iZevWxoTv7m20uo7Q/FuHvQx25kz X-Google-Smtp-Source: APXvYqzLWtQJ+bUN46xBQKxQOfytbUMLBQTKH1xJ3o+iwnVg7mgodRy5RhKkkopvjs4bbqJqnnnRew== X-Received: by 2002:ac8:4289:: with SMTP id o9mr76710977qtl.277.1578335111312; Mon, 06 Jan 2020 10:25:11 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:10 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 11/59] exec.c: remove 'err' label in ram_block_discard_range() Date: Mon, 6 Jan 2020 15:23:37 -0300 Message-Id: <20200106182425.20312-12-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Paolo Bonzini , Daniel Henrique Barboza Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'err' is a label that just executes 'return ret'. We can remove the label and simply 'return ret' on error. CC: Paolo Bonzini Signed-off-by: Daniel Henrique Barboza --- exec.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/exec.c b/exec.c index d4b769d0d4..7cfd80826e 100644 --- a/exec.c +++ b/exec.c @@ -3898,7 +3898,7 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length) if ((uintptr_t)host_startaddr & (rb->page_size - 1)) { error_report("ram_block_discard_range: Unaligned start address: %p", host_startaddr); - goto err; + return ret; } if ((start + length) <= rb->used_length) { @@ -3906,7 +3906,7 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length) if (length & (rb->page_size - 1)) { error_report("ram_block_discard_range: Unaligned length: %zx", length); - goto err; + return ret; } errno = ENOTSUP; /* If we are missing MADVISE etc */ @@ -3930,14 +3930,14 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length) error_report("ram_block_discard_range: Failed to fallocate " "%s:%" PRIx64 " +%zx (%d)", rb->idstr, start, length, ret); - goto err; + return ret; } #else ret = -ENOSYS; error_report("ram_block_discard_range: fallocate not available/file" "%s:%" PRIx64 " +%zx (%d)", rb->idstr, start, length, ret); - goto err; + return ret; #endif } if (need_madvise) { @@ -3953,14 +3953,14 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length) error_report("ram_block_discard_range: Failed to discard range " "%s:%" PRIx64 " +%zx (%d)", rb->idstr, start, length, ret); - goto err; + return ret; } #else ret = -ENOSYS; error_report("ram_block_discard_range: MADVISE not available" "%s:%" PRIx64 " +%zx (%d)", rb->idstr, start, length, ret); - goto err; + return ret; #endif } trace_ram_block_discard_range(rb->idstr, host_startaddr, length, @@ -3971,7 +3971,6 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length) rb->idstr, start, length, rb->used_length); } -err: return ret; } From patchwork Mon Jan 6 18:23:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218349 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Av4AJcvt"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s42j5plrz9sPK for ; Tue, 7 Jan 2020 05:35:57 +1100 (AEDT) Received: from localhost ([::1]:57802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXEJ-00061H-CH for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:35:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45265) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX3z-0001rK-Cu for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX3y-00041B-AV for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:15 -0500 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:42440) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX3y-00040c-6Y; Mon, 06 Jan 2020 13:25:14 -0500 Received: by mail-qv1-xf42.google.com with SMTP id dc14so19417067qvb.9; Mon, 06 Jan 2020 10:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2sphsqeXWmt2nxo4pNzgWsK8+C0EHag/7k5lhcriuzg=; b=Av4AJcvtOUy0CPFhaBCz5ZiTaJBTugY4UUMcxbFchMXiPFODV4/+bNN9oek01Hr/mm a+/YWlQVlxaYId52fmeEyF/wjVdQuaEwy99GiNaewgcGiIa3Nv3loeoxiCUZ2s6MKPrT BiLcFeXvdMBLWJdGlch/A64fEP1Ukve/Pdv3iu8pS0KKCP7j/LoySaaEWLYU4tmUUUr9 3ffW3i+21mwvqfyC5jabllUT9zp/qIx3GWzKRIAhyNmhkILZBp0eg4nNBWfyHSL9XG3Z gvCPOWw/UbeyXTMnxAR9eNtVIIZ5OnEVgjg5cPpspNheg3OYOPNdwvH2K+V8ilyvTxEg /UMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2sphsqeXWmt2nxo4pNzgWsK8+C0EHag/7k5lhcriuzg=; b=SnwP7x/kyX8olKKXOUPJ7WLKZEzrSqSINF0BtW1ZT2G5hrc4pvpQV95edIVSBxfiwx Mq5E0azDCotqmm7WaLS2B7hE7iHgp4rd4WTGIAUmyM2DpZ9OFn5qzoMpe//wHevrcSfk diY9cVEsRoJIih5Kbdc4eZTR8VgtfzBsDBxat9idszbsqXokLS48o7Y8ZzVzDJ1nBG/z EI1oejSGXctA/Hx8E3v74IGfhpkFdxhAYqiPin+3kbLTgNT7VxbxCMt8GJdFwyqTjLcX w2s3uND5RxmYM6pMkh6mqWJVQQbAwMy3A8fJZvqmNKVfL3PW3FToyVfVhcmczhVGjHey tw5g== X-Gm-Message-State: APjAAAW7CdJD1EXF7wOoCGjAxr7/dxWmpzOT5Cfv2kBDiaeHKnN05NkO 8vJetJ1FJTp0rWuXVWN1bYG7juu0 X-Google-Smtp-Source: APXvYqxbEPLQoXbbC7smuVlCk3eHBMp7zY0FXnL4X+Wuae99p+OfYQTKcEB/oFd0Z+KlU3OEqpDJrw== X-Received: by 2002:ad4:4e68:: with SMTP id ec8mr80760104qvb.203.1578335113486; Mon, 06 Jan 2020 10:25:13 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:12 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 12/59] virtfs-proxy-helper.c: remove 'err_out' label in setugid() Date: Mon, 6 Jan 2020 15:23:38 -0300 Message-Id: <20200106182425.20312-13-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f42 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'err_out' can be removed and be replaced by 'return -errno' in its only instance in the function. CC: Greg Kurz Signed-off-by: Daniel Henrique Barboza Acked-by: Greg Kurz --- fsdev/virtfs-proxy-helper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c index 0d4de49dcf..aa1ab2590d 100644 --- a/fsdev/virtfs-proxy-helper.c +++ b/fsdev/virtfs-proxy-helper.c @@ -287,8 +287,7 @@ static int setugid(int uid, int gid, int *suid, int *sgid) *sgid = getegid(); if (setresgid(-1, gid, *sgid) == -1) { - retval = -errno; - goto err_out; + return -errno; } if (setresuid(-1, uid, *suid) == -1) { @@ -322,7 +321,6 @@ err_sgid: if (setresgid(-1, *sgid, *sgid) == -1) { abort(); } -err_out: return retval; } From patchwork Mon Jan 6 18:23:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218355 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gWSKhXgW"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s47d16G8z9sPK for ; Tue, 7 Jan 2020 05:40:13 +1100 (AEDT) Received: from localhost ([::1]:57888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXIQ-0004CC-GN for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:40:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45297) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX41-0001uc-LF for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX40-00043W-56 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:17 -0500 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:46125) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX40-00042q-0F; Mon, 06 Jan 2020 13:25:16 -0500 Received: by mail-qv1-xf43.google.com with SMTP id u1so18595118qvk.13; Mon, 06 Jan 2020 10:25:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JYeXo1PZyJ3bV7EW4va4cPF2eGfCKteiWZKnaCT0LBw=; b=gWSKhXgWxHgTVSyrxbw5oJ/d/BrxyglvHXecQ9nrd1nu1vWZN6BSx8UyreJZ/M2Ymv l7d9fLf8MuYu0uvEA1l8lOF1GiAVb68ZkzYuwaoaQM/cgLcWG0UYjAzBkge53M+5Fcwp 1yBa+4USzdtZJwesk6R7HL3aNWVOI9JrmPBfBMfRnUh3tq4i3X399vTK9kbRvNMUgeGQ IFpJ/TOCYmVt00vgv+CG0HEVun7QlAu1NvWheOQJDp1LQJtB9r7DgMeR/RFnJsU2pgMU +P67sQsfxaqoqDZhieYgssNvehYBu/lW4qLqzXu5A5Mvvkr4zyo9Bb/yX2V/QVqFTLcj dzdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JYeXo1PZyJ3bV7EW4va4cPF2eGfCKteiWZKnaCT0LBw=; b=hLWFJ4yF4V8isEy0gmTDH+TFLIj4VwJ5Y581TNDFfBwrxokxR5dUUMcZ6CEF0KntSy LrhWWjmqTH85JBtPHLX0OK6i6JcAxkQE77LYyB3orXxr8lDjj8rxFua3FUyHOxnnzY5b nn94PhGiOc3s5J21qTNmiV+9fJuBQPvLIeS5cVLHfTBOr1pD4omHP8Sn2omJY0IRyrWn oQk5LYv6enItsOhlDDdvdQtLLPn58I9IZkCD1n9W56HL5IwrNjGW0eorD+mNDD/hAPPW CmOd8HffU/hKUCIzmT5j5IpkBchZwXJmpNjjVvpP7VBMdbf/hG8B7Lwwg35VwczRcMu+ eHAg== X-Gm-Message-State: APjAAAWohdwwwB+EVWL1CmAX1+QcPwwG4v3P8JKMHlvqZgk7q/AmUlpA u1eDcZaelUv36PVmOLzCvXDogOvQ X-Google-Smtp-Source: APXvYqzp+VHHwmI3uPG7Wjis4BMw6w1fISV9ea/h3lm2ND4OXS3Gr3UsCu7/I71BgTJTYUxKMxzCSA== X-Received: by 2002:a05:6214:1348:: with SMTP id b8mr80477849qvw.137.1578335115308; Mon, 06 Jan 2020 10:25:15 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:15 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 13/59] block/vdi.c: remove 'fail' label in vdi_open() Date: Mon, 6 Jan 2020 15:23:39 -0300 Message-Id: <20200106182425.20312-14-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f43 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Stefan Weil , Daniel Henrique Barboza , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The 'fail' label can be replaced by 'return ret' or by a 'return' with the error code that was being set right before the 'goto' call. CC: Stefan Weil CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- block/vdi.c | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 0142da7233..6d486ffed9 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -388,7 +388,7 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags, ret = bdrv_pread(bs->file, 0, &header, sizeof(header)); if (ret < 0) { - goto fail; + return ret; } vdi_header_to_cpu(&header); @@ -400,8 +400,7 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags, error_setg(errp, "Unsupported VDI image size (size is 0x%" PRIx64 ", max supported is 0x%" PRIx64 ")", header.disk_size, VDI_DISK_SIZE_MAX); - ret = -ENOTSUP; - goto fail; + return -ENOTSUP; } uuid_link = header.uuid_link; @@ -418,58 +417,48 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags, if (header.signature != VDI_SIGNATURE) { error_setg(errp, "Image not in VDI format (bad signature %08" PRIx32 ")", header.signature); - ret = -EINVAL; - goto fail; + return -EINVAL; } else if (header.version != VDI_VERSION_1_1) { error_setg(errp, "unsupported VDI image (version %" PRIu32 ".%" PRIu32 ")", header.version >> 16, header.version & 0xffff); - ret = -ENOTSUP; - goto fail; + return -ENOTSUP; } else if (header.offset_bmap % SECTOR_SIZE != 0) { /* We only support block maps which start on a sector boundary. */ error_setg(errp, "unsupported VDI image (unaligned block map offset " "0x%" PRIx32 ")", header.offset_bmap); - ret = -ENOTSUP; - goto fail; + return -ENOTSUP; } else if (header.offset_data % SECTOR_SIZE != 0) { /* We only support data blocks which start on a sector boundary. */ error_setg(errp, "unsupported VDI image (unaligned data offset 0x%" PRIx32 ")", header.offset_data); - ret = -ENOTSUP; - goto fail; + return -ENOTSUP; } else if (header.sector_size != SECTOR_SIZE) { error_setg(errp, "unsupported VDI image (sector size %" PRIu32 " is not %u)", header.sector_size, SECTOR_SIZE); - ret = -ENOTSUP; - goto fail; + return -ENOTSUP; } else if (header.block_size != DEFAULT_CLUSTER_SIZE) { error_setg(errp, "unsupported VDI image (block size %" PRIu32 " is not %" PRIu32 ")", header.block_size, DEFAULT_CLUSTER_SIZE); - ret = -ENOTSUP; - goto fail; + return -ENOTSUP; } else if (header.disk_size > (uint64_t)header.blocks_in_image * header.block_size) { error_setg(errp, "unsupported VDI image (disk size %" PRIu64 ", " "image bitmap has room for %" PRIu64 ")", header.disk_size, (uint64_t)header.blocks_in_image * header.block_size); - ret = -ENOTSUP; - goto fail; + return -ENOTSUP; } else if (!qemu_uuid_is_null(&uuid_link)) { error_setg(errp, "unsupported VDI image (non-NULL link UUID)"); - ret = -ENOTSUP; - goto fail; + return -ENOTSUP; } else if (!qemu_uuid_is_null(&uuid_parent)) { error_setg(errp, "unsupported VDI image (non-NULL parent UUID)"); - ret = -ENOTSUP; - goto fail; + return -ENOTSUP; } else if (header.blocks_in_image > VDI_BLOCKS_IN_IMAGE_MAX) { error_setg(errp, "unsupported VDI image " "(too many blocks %u, max is %u)", header.blocks_in_image, VDI_BLOCKS_IN_IMAGE_MAX); - ret = -ENOTSUP; - goto fail; + return -ENOTSUP; } bs->total_sectors = header.disk_size / SECTOR_SIZE; @@ -482,8 +471,7 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags, bmap_size = DIV_ROUND_UP(bmap_size, SECTOR_SIZE); s->bmap = qemu_try_blockalign(bs->file->bs, bmap_size * SECTOR_SIZE); if (s->bmap == NULL) { - ret = -ENOMEM; - goto fail; + return -ENOMEM; } ret = bdrv_pread(bs->file, header.offset_bmap, s->bmap, @@ -509,8 +497,6 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags, fail_free_bmap: qemu_vfree(s->bmap); - - fail: return ret; } From patchwork Mon Jan 6 18:23:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218342 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IxLtAmrP"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s3vZ0M2Tz9s29 for ; Tue, 7 Jan 2020 05:29:46 +1100 (AEDT) Received: from localhost ([::1]:57698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX8J-0007MT-MY for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:29:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45325) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX42-0001wc-Vo for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX41-00044w-QQ for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:18 -0500 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:38115) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX41-00044T-MG; Mon, 06 Jan 2020 13:25:17 -0500 Received: by mail-qk1-x742.google.com with SMTP id k6so40295908qki.5; Mon, 06 Jan 2020 10:25:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BIyO2R/e5VA+08g+h58CqbpLSi6LpjdAOK3scVDW2ro=; b=IxLtAmrPYJNVPDNfzTVeql5qlu94afy0FGMz/4NHeAI8s0HsNdythteFYv1RHMX/7u 7P7pJqBh2NU48A6Wkpnxv6m/c9zkiNqus/asZembCTFVE8hbDUKs65Ww92pWcL6lkxvz xB69e7QKjTfWFw3jXSFHlhdO+ldo28ujYOCo+t0G1fHutArsYNeZZ8YABPncOwSLWIck YVnOcR7pCiwLMJN0u668fCZVWvHHttQ0FUv2NHRG7Vy3yN68a6409BHPyYbBJxa5xuAq L36dMdJ94SEZPMUV9NpZsZQoREYeWi/Ke3Xc8Y6SDs6sapalojsmJsSk8eOUO4svV4dR uJlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BIyO2R/e5VA+08g+h58CqbpLSi6LpjdAOK3scVDW2ro=; b=YUiCNJf4A19LHG7MBeFaaHbgX+KBkGCPhdNElaTvoX+TllUWFA8hL11pQqO4W0rOMg Ufm+FrKkx2N4meq78ugxrffmsf5sujDEaVI/n16QXmroP7zhKL496sBPaI+Jg8TbZQYR 6rWCF1Kz1gKKrO4E1RQvyVAYgCg+AXn2/UhoPXrbgeBPlvU8gqWFIu9s16qaJuQjRNDi DBpBiDWqzjvNBS7Xy+8Mv9Z90aUdhJMzEDsWeK+GcoYCin8mSe+HjeDlvw26/0BHpdVd GIuX6JOxhw6mPZzonP/bR/3emk4LtkmKdA7CdTrqA/2ipc01MDG7XM4UcO2IQhbUSP+p P9rA== X-Gm-Message-State: APjAAAVCgsflyiwrDgwIkVmDcbpMGmbZJXVdSlU4AJfa85+/EJXvxN2X Ge34t8aoEW9HzSoUnsviX+cHpjqi X-Google-Smtp-Source: APXvYqxH254lKZYuyTcHA2ZEi/wut8AKP6ECTaVz8jKgldIYPG/JO+PG1eBhuv5eAT4iDYHgzKuwEg== X-Received: by 2002:a37:8e03:: with SMTP id q3mr82843572qkd.395.1578335117004; Mon, 06 Jan 2020 10:25:17 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:16 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 14/59] block/file-posix.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:23:40 -0300 Message-Id: <20200106182425.20312-15-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kevin Wolf , Daniel Henrique Barboza , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label from cdrom_probe_device() can be removed, and its only instance replaced by 'return prio'. In raw_co_create(), 'out' can be replaced by 'return -errno' in the error condition it is being called. CC: Kevin Wolf CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- block/file-posix.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 1b805bd938..b1a6549806 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2265,9 +2265,8 @@ raw_co_create(BlockdevCreateOptions *options, Error **errp) /* Create file */ fd = qemu_open(file_opts->filename, O_RDWR | O_CREAT | O_BINARY, 0644); if (fd < 0) { - result = -errno; - error_setg_errno(errp, -result, "Could not create file"); - goto out; + error_setg_errno(errp, errno, "Could not create file"); + return -errno; } /* Take permissions: We want to discard everything, so we need @@ -2342,7 +2341,7 @@ out_close: result = -errno; error_setg_errno(errp, -result, "Could not close the new file"); } -out: + return result; } @@ -3554,7 +3553,7 @@ static int cdrom_probe_device(const char *filename) fd = qemu_open(filename, O_RDONLY | O_NONBLOCK); if (fd < 0) { - goto out; + return prio; } ret = fstat(fd, &st); if (ret == -1 || !S_ISBLK(st.st_mode)) { @@ -3568,7 +3567,6 @@ static int cdrom_probe_device(const char *filename) outc: qemu_close(fd); -out: return prio; } From patchwork Mon Jan 6 18:23:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218359 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PnwIgj7M"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4Bt4fPRz9sPK for ; Tue, 7 Jan 2020 05:43:02 +1100 (AEDT) Received: from localhost ([::1]:57946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXLA-00081s-7k for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:43:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45349) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX44-0001zH-P6 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX43-00046c-Mm for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:20 -0500 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:45614) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX43-00046G-Ih; Mon, 06 Jan 2020 13:25:19 -0500 Received: by mail-qv1-xf41.google.com with SMTP id l14so19415266qvu.12; Mon, 06 Jan 2020 10:25:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hSgP8NRncEIEX6pPa78Nm0OrXSlmyhM+fq2uskBfwUQ=; b=PnwIgj7Mss+7c3FRHg/gxnuuuKT8VRVeMsMvCbh1H4EGvXB3DM2fzXTh5jB0Rkh2Nn JCW4h8jtc19hRCb2cAOxvhCJC05xHS92i2Zm+j5y/OZJwI+goDz5791lDCJwzm5ERSeH WyEgduHpVUIVR6CNKpZSeLfVr8/wH9iGgMwLxf7nhDIEiTcm2Wxk0kgicREh0VB+jcE3 /wsN8ac/2tnyy0LXicEg4VGn+YEY9hzwjeI1TBRwY7YeDZm2TgQLxbuwAVScuhpewABw MdJWkCG0Rn0e1e7Z310As33vFUSeFS0x4GdRDnDesE1Yn78gGk2VZMB5VhNk0wq8/8nl 3ZVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hSgP8NRncEIEX6pPa78Nm0OrXSlmyhM+fq2uskBfwUQ=; b=DGuWTI4uDeeyoIWwxJ7jx6Y5Nquo7EUUV1bUzWQmoQEELbv6gIfvzOFwJ/+W8kpoDF v7gm7/3Zs0QDU+5NePMSz/U+LrygWULskNSKjI8p2bzJO9U0gNKz/fUiZhY/axUwwi0p 3hrQ+xPZESr2hlXcCy8JW4lvB8Qr4eZUHAGG5RYvv3aD3abII59iCBdLBgbT1yRvzpCt 8UPd51Tli28FwjroUTXXr45a8xsJmSENZEv94/mpzMzG3XT9lH+TPjZ4B4ypX3t+4Ub2 x+Xybzzl5sRO1O2TQvJ3pK37AbOEDUQMCJRz+IJe8QIs297XiRlZYpPc6sv/jqBDlDAB RtOA== X-Gm-Message-State: APjAAAUPkRzRp7jf65vPj0r9qql3eFHPcyx+g3CiOR98yzPcf2Iyx4Y3 TS6c81Gzui2WyfhNmOpTgCwYiq6l X-Google-Smtp-Source: APXvYqxX16Cv1Akxg3pbiFk+LwU7ID3SXP4GXRzIaaySsTIEkjSILzEueIMKSMxhXeNKoZzSZuNfdA== X-Received: by 2002:a0c:8bd2:: with SMTP id a18mr53137941qvc.38.1578335118942; Mon, 06 Jan 2020 10:25:18 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:18 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 15/59] block/blkreplay.c: remove unneeded 'fail' label in blkreplay_open() Date: Mon, 6 Jan 2020 15:23:41 -0300 Message-Id: <20200106182425.20312-16-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f41 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Paolo Bonzini , Daniel Henrique Barboza , Pavel Dovgalyuk Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Both the 'fail' label and the 'ret' variable can be removed. Use 'return -EINVAL' in the error condition and 'return 0' in the end of the function. CC: Pavel Dovgalyuk CC: Paolo Bonzini Signed-off-by: Daniel Henrique Barboza Reviewed-by: Pavel Dovgalyuk --- block/blkreplay.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/block/blkreplay.c b/block/blkreplay.c index c96ac8f4bc..d8c4c311f3 100644 --- a/block/blkreplay.c +++ b/block/blkreplay.c @@ -24,23 +24,19 @@ static int blkreplay_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { Error *local_err = NULL; - int ret; /* Open the image file */ bs->file = bdrv_open_child(NULL, options, "image", bs, &child_file, false, &local_err); if (local_err) { - ret = -EINVAL; error_propagate(errp, local_err); - goto fail; + return -EINVAL; } bs->supported_write_flags = BDRV_REQ_WRITE_UNCHANGED; bs->supported_zero_flags = BDRV_REQ_WRITE_UNCHANGED; - ret = 0; -fail: - return ret; + return 0; } static int64_t blkreplay_getlength(BlockDriverState *bs) From patchwork Mon Jan 6 18:23:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CjbbnBbZ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4Gx5BPFz9sPK for ; Tue, 7 Jan 2020 05:46:33 +1100 (AEDT) Received: from localhost ([::1]:57994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXOZ-0003YP-An for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:46:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45392) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX47-00022a-DI for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX45-000485-AK for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:23 -0500 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:33219) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX45-00047m-4l; Mon, 06 Jan 2020 13:25:21 -0500 Received: by mail-qv1-xf41.google.com with SMTP id z3so19446137qvn.0; Mon, 06 Jan 2020 10:25:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tFptgxo5nLcHuBzNhDqkhDGvP/NtmbUAgg4er/i3OcI=; b=CjbbnBbZeH65SvqiUKCUdLGlmqNvamFF0SCoUPUUECYmNgvoxr20Hho/d2NoFjC/4n +ywLwA3JsotAuqchbZE06Kis3BhMSNOZ2xrNZZPa4+JNO6u2p6O8JN2NWJCVcoVh04o/ E7aHRSIznAfeFO3aFLQXJ7eSw8pq4ZowRdjG3BdZPMsIacaX16L70D1xJa/dYgiJSEEe P7yNhPp1HXobhQzQkRIfAF/G0Wo8uOtIRFeEMktzBa9U7HJN21+BzEiO8TJehE+TPab9 MeXbZbMbJIcDAsRnstHY17ZCJ6drHm/8qvpNVtyX7Z5E2u9zWPKyrNTYN2RDemiINZP7 Gegw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tFptgxo5nLcHuBzNhDqkhDGvP/NtmbUAgg4er/i3OcI=; b=FgGYmcLGbs6Tsj8NhenRRk2DEYK9bUM9VeoBDchWtS/28bFFI5je745nMBRe6FFiSI zZahaPUTgrbmVIUWms2h9N1BbgVUeKfeMq0bDcXvOP9DosH1Z+3f1UMsRG0zYdwb5XUU Z+FPqTOlH0yx4i073NgU/syPBdfFkbYZI2mR0yyfMa9J8nh2k4N+Rl6NFTn9eK5iFqMz 2OCYIBNe5T0D8p/55YH0vta8V80SEqB0pL2mxceiK93gUNt11lQutsr/R3eaLYDilnyw soqrvbBUCXVciyMWXVK4BdCoANONl3AR3NchTykAQUJY2JDq5IzziM+/Cmse09mFZNnN NfKQ== X-Gm-Message-State: APjAAAXh5CU7a7q9qRZ1g5W5uIUnFoKIR+u3DISHMG5SVVFbtanFUO+f 5WZ3g7TZc2jgOwEhCjZWIlty3szL X-Google-Smtp-Source: APXvYqymKbrnOHEYtNhyMzPUU1W18xtiLJrqeXj/Id6ujn5bb5mLTq9mC92G0kVdcTfeMFvWLV05rw== X-Received: by 2002:a0c:e2d1:: with SMTP id t17mr82517992qvl.25.1578335120624; Mon, 06 Jan 2020 10:25:20 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:20 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 16/59] block/gluster.c: remove unneeded 'exit' label Date: Mon, 6 Jan 2020 15:23:42 -0300 Message-Id: <20200106182425.20312-17-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f41 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'exit' label in find_allocation() can be replaced by a 'return -ENOTSUP' call. CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- block/gluster.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/gluster.c b/block/gluster.c index 4fa4a77a47..43bf76eed7 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -1381,7 +1381,7 @@ static int find_allocation(BlockDriverState *bs, off_t start, BDRVGlusterState *s = bs->opaque; if (!s->supports_seek_data) { - goto exit; + return -ENOTSUP; } #if defined SEEK_HOLE && defined SEEK_DATA @@ -1466,7 +1466,6 @@ static int find_allocation(BlockDriverState *bs, off_t start, return -EBUSY; #endif -exit: return -ENOTSUP; } From patchwork Mon Jan 6 18:23:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218367 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eO/AqUVM"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4MM3L63z9sPn for ; Tue, 7 Jan 2020 05:50:23 +1100 (AEDT) Received: from localhost ([::1]:58054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXSG-0007lu-PG for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:50:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45416) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX48-00024C-EM for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX47-00049j-8H for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:24 -0500 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:43226) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX47-00049R-3z; Mon, 06 Jan 2020 13:25:23 -0500 Received: by mail-qv1-xf42.google.com with SMTP id p2so19407459qvo.10; Mon, 06 Jan 2020 10:25:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AQ30SiavMBc1O6qPtvk0xgAULn2vwWgQBHbs/PLUbI8=; b=eO/AqUVMui9U6V4k1266lbWw9rHB6L1/xQKK9x30mQ8ILZg7Wj6nXgXUTRudpF1J1G 6FABU8/sNTARDGMPGCjHZHS6sZ2Cjr3RSBUY7s0d6ipN4okgaDy3N1BxvUD79bBl77z2 Ev5/wUAvrl2KfeDaF+EwO7m7camnfr6OTyfdS1ntFDov9WF7CDLcHbriiMldC2IyDsD4 iQpLdrsZaagqfp7eoQpzG0xoTW2+I5xsSwUvBEAW2uE8gC+hp9VS+Vwg/TvzFqMi/CPh exC/csYIhV3cyoDllSgzE7Kfy5AnyjYVB0Mo0RBkdV/PcKkszn/3lMFAVQbrLyBEm+TM FwUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AQ30SiavMBc1O6qPtvk0xgAULn2vwWgQBHbs/PLUbI8=; b=D+FqbNPJz2i5kdbY71RojygEw89XLNpU/bVvLNYbVvFNGgfPBSXjZC0Ej1wN+STtnq kt/0CPPSAHyFoHkQifrV7NXgUrvJdMaJn2I2KIQKXwsKOtCbRRo8kspiQIHK6mMqpZTM s2wiwBBeHvuP6fyTwGtPym2fUgVQblpmCdz0SOhJFGMkevJbMXvVn5Ik5wbkfth4EwvJ 2gBEvQRkaEIC2gHM9y/43nGTZRGvd13cfCXzrHGe2Ts92OoxHXbfGW3/1fhKB4W9FTIi +Q+pRkXgydzI3j79RBwuPMCSgIK5nKV7wacXgwJSZ7aJuAFvoof7xULEsGMeb4UYMHGp RAdw== X-Gm-Message-State: APjAAAUZpS9CN9VNdDI88LqFAnF3iq8HC2tp5YoGPobG4SbgjBzlOaFw 6biPkpDwyku6Vbc44pNYfq3Qs7V5 X-Google-Smtp-Source: APXvYqxOrPWINPn22Tyf/XmY642bRM7VWtoZbvGTLor0xos/mdHd9Ta3OD1J1WE+mG5vddqcaLHxQg== X-Received: by 2002:a0c:c18f:: with SMTP id n15mr68377057qvh.35.1578335122527; Mon, 06 Jan 2020 10:25:22 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:22 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 17/59] block/dmg.c: remove unneeded 'fail' label in dmg_read_mish_block() Date: Mon, 6 Jan 2020 15:23:43 -0300 Message-Id: <20200106182425.20312-18-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f42 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , qemu-block@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Both the 'fail' label and 'ret' variable can be removed from the function. Instead, call 'return -EINVAL' in the error conditions. CC: Stefan Hajnoczi CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza Reviewed-by: Stefan Hajnoczi --- block/dmg.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/block/dmg.c b/block/dmg.c index 4a045f2b3e..ce39a87864 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -217,7 +217,6 @@ static int dmg_read_mish_block(BDRVDMGState *s, DmgHeaderState *ds, uint8_t *buffer, uint32_t count) { uint32_t type, i; - int ret; size_t new_size; uint32_t chunk_count; int64_t offset = 0; @@ -273,8 +272,7 @@ static int dmg_read_mish_block(BDRVDMGState *s, DmgHeaderState *ds, error_report("sector count %" PRIu64 " for chunk %" PRIu32 " is larger than max (%u)", s->sectorcounts[i], i, DMG_SECTORCOUNTS_MAX); - ret = -EINVAL; - goto fail; + return -EINVAL; } /* offset in (compressed) data fork */ @@ -288,8 +286,7 @@ static int dmg_read_mish_block(BDRVDMGState *s, DmgHeaderState *ds, error_report("length %" PRIu64 " for chunk %" PRIu32 " is larger than max (%u)", s->lengths[i], i, DMG_LENGTHS_MAX); - ret = -EINVAL; - goto fail; + return -EINVAL; } update_max_chunk_size(s, i, &ds->max_compressed_size, @@ -298,9 +295,6 @@ static int dmg_read_mish_block(BDRVDMGState *s, DmgHeaderState *ds, } s->n_chunks += chunk_count; return 0; - -fail: - return ret; } static int dmg_read_resource_fork(BlockDriverState *bs, DmgHeaderState *ds, From patchwork Mon Jan 6 18:23:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218353 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="O6ArrT20"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s45X5J9qz9sPK for ; Tue, 7 Jan 2020 05:38:24 +1100 (AEDT) Received: from localhost ([::1]:57866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXGg-0001MI-2u for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:38:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45443) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4B-00025s-6q for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX49-0004CU-PK for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:27 -0500 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:46975) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX48-0004BY-SC; Mon, 06 Jan 2020 13:25:24 -0500 Received: by mail-qk1-x744.google.com with SMTP id r14so40253712qke.13; Mon, 06 Jan 2020 10:25:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pow/5Z2bAbGCDH4hbr5Mur0CSZ4ZY/agAkg/ACDkDZ0=; b=O6ArrT20JB0/YZXuReV5drE66ncq7KfKgtG8G6AlTLIwqMGmnO475rEpkucFjrTPYv wWARQwKOSDhQsCDhiekVFrmO9KCiTzr5Kat9RVZvE/NmDWVJQwaV0k+1h0X5dW91CeC+ DW72POEdFxKAMJFPhBT7FRlaqXxypExV/pSz1beW5g619qBGgdvMyV53OglJbIpUCv14 Yu7i0l8Y7/gZ7jupfhBRdeFWFGeXxBeP6WE1Ml1p1JVXVfbv5pJ+8l0cVwznBy5d+cLK tqeCFjbQ4QIpvVna6eblN3TddJ8xY/0soEHHUYff8uYqHHxVpeLlWt3h+De1ZEhSQu/q plOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pow/5Z2bAbGCDH4hbr5Mur0CSZ4ZY/agAkg/ACDkDZ0=; b=H4hINKhTWqJNtiSPQJoxV9D3x2SQnyclyhrzqvHV81w8kw0dvQO5YDuGiUWYb995PT xnTnWYYwrp5YD0eloq5+3BSbaYd7IeP76hYi7Gd5fepv+zuqhzqlMscVaOknmSXMLuEj 4vqUZu4pe9mjoF06d+X/rSv4ogUWGVpuboj2wTfaojgLkW+oQ1/BubappQgKI/GOGeKo yFNRWDU09gaXMlKbkfRRQTHlHwyOo0nGCjfE+lNtxOswjKtXWMo7nWazxNk+cWwhaE+7 5AVnCH2Xj2r3Mx2TMY7OjIKgrKblpvXh5vhgoqmdLtWHhExRTRw22hkxchMU2IVSULBs ppnw== X-Gm-Message-State: APjAAAXdDBzmmOzcZ3glkJNxLU1tOFTh5OLA17yEJKHOY2YudC26Ywkk nRU8M+jqxYaU/mt0v90lYo46voHx X-Google-Smtp-Source: APXvYqwTQSm0S+pxsKqQKEDTkChAA5zcEGP4fQuGs0g4MI6u+vnRzeP0qhLoy59GQyQd/aUTo8xhvw== X-Received: by 2002:a05:620a:6b8:: with SMTP id i24mr86399499qkh.9.1578335124342; Mon, 06 Jan 2020 10:25:24 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:24 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 18/59] qcow2-refcount.c: remove unneeded 'fail' label in qcow2_refcount_init() Date: Mon, 6 Jan 2020 15:23:44 -0300 Message-Id: <20200106182425.20312-19-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kevin Wolf , Daniel Henrique Barboza , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'fail' label can be replaced by 'return ret' and 'return -ENOMEM' calls. CC: Kevin Wolf CC: Max Reitz CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- block/qcow2-refcount.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index f67ac6b2d8..1fe66677d1 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -111,22 +111,19 @@ int qcow2_refcount_init(BlockDriverState *bs) if (s->refcount_table_size > 0) { if (s->refcount_table == NULL) { - ret = -ENOMEM; - goto fail; + return -ENOMEM; } BLKDBG_EVENT(bs->file, BLKDBG_REFTABLE_LOAD); ret = bdrv_pread(bs->file, s->refcount_table_offset, s->refcount_table, refcount_table_size2); if (ret < 0) { - goto fail; + return ret; } for(i = 0; i < s->refcount_table_size; i++) be64_to_cpus(&s->refcount_table[i]); update_max_refcount_table_index(s); } return 0; - fail: - return ret; } void qcow2_refcount_close(BlockDriverState *bs) From patchwork Mon Jan 6 18:23:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218371 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mQhipP9o"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4QQ0mdCz9sPK for ; Tue, 7 Jan 2020 05:53:00 +1100 (AEDT) Received: from localhost ([::1]:58096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXUn-0003PA-Od for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:52:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45477) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4C-000284-M8 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4B-0004E5-EB for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:28 -0500 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:38116) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4B-0004DU-4H; Mon, 06 Jan 2020 13:25:27 -0500 Received: by mail-qk1-x741.google.com with SMTP id k6so40296404qki.5; Mon, 06 Jan 2020 10:25:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iIYRPlSXfjPSgphJVr9MrieAqsI8xts4nkwFUXyHtYQ=; b=mQhipP9oLD5WYxqXU3Jf1sX/+F2XCuz17PnDMVOQGuSYlA3ITIeH4GDfHo5O9OLRAi mpbP56gc+LoBIWpZpz3A+ESeexNycfiOo1O2ieYVo+FriFiqkp11MFrBAL5+WGE1mGj5 Q6YB0MM+1pK2HWLfKBV2Q3iJzy6VpY1GL93KunDPDXcZa+zkf3BlSFtOtDp2bhk1wPz6 gnXS4qGhYPas6OybiOE4st28V0WnQlAf1trWanaB59bweCqfsDUvEY+ZCUE9MlpdAgeS /aIn9BVLx75tuQsEM1IFY9+AAavV0NjSP6/smv8WV35hLxj7pltxOve41CM9MCN+3t7E sF3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iIYRPlSXfjPSgphJVr9MrieAqsI8xts4nkwFUXyHtYQ=; b=dEOrwk/YTq0tG4RqGgcBXIukwJu/yYVInUkx1P1W0SCl81L+KsDlWLqTLEHsst0iL+ QgYAH2nMtSIhfxOWus392CiIHFMdoiZPPcsxLgSJEe1cLXrMOvzrAo6rxfM3oce3vgbK feBaAQ2S1R61QYjP4DgaR0mjwOoVqomA6peMlj3D3mW8lhAnhSVFInjXIItQ8oK6hG9C n/yMvc87eC6mdxYmHc70DZty/lwS8DImrqmz342+VVyo5xywjeEINSvpF3Zm/N4YI/sn 3F3D1K1FN9hMQ+M6LNaWaZkke7rCFzj5BkpyiAAl4higMEZabO9wSAj5+A6ewd+E5XPI tJ+g== X-Gm-Message-State: APjAAAWP5MzqYJH0elyBd1l2a/v2BX6k6J8wOgipmXAfoLWwLWrhZLQQ qK0f+1oUpj5+WVhIWyQivhsoaWt6 X-Google-Smtp-Source: APXvYqyr26GEbIsdAlLQPqpzzUEP+eCeLvGjtbIaTl7QyANUHBEppluPjmQ1RudJ9NcQqRSQ6A7raw== X-Received: by 2002:a37:684b:: with SMTP id d72mr85753234qkc.293.1578335126320; Mon, 06 Jan 2020 10:25:26 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:25 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 19/59] block/ssh.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:23:45 -0300 Message-Id: <20200106182425.20312-20-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , "Richard W . M . Jones" , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The 'out' labels for check_host_key_knownhosts() and authenticate() functions can be removed and, instead, call 'return' with the appropriate return value. The 'ret' integer from both functions could also be removed. CC: Richard W.M. Jones CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza Reviewed-by: Richard W.M. Jones --- block/ssh.c | 61 +++++++++++++++++------------------------------------ 1 file changed, 19 insertions(+), 42 deletions(-) diff --git a/block/ssh.c b/block/ssh.c index b4375cf7d2..e0c56d002a 100644 --- a/block/ssh.c +++ b/block/ssh.c @@ -276,7 +276,6 @@ static void ssh_parse_filename(const char *filename, QDict *options, static int check_host_key_knownhosts(BDRVSSHState *s, Error **errp) { - int ret; #ifdef HAVE_LIBSSH_0_8 enum ssh_known_hosts_e state; int r; @@ -295,7 +294,6 @@ static int check_host_key_knownhosts(BDRVSSHState *s, Error **errp) trace_ssh_check_host_key_knownhosts(); break; case SSH_KNOWN_HOSTS_CHANGED: - ret = -EINVAL; r = ssh_get_server_publickey(s->session, &pubkey); if (r == 0) { r = ssh_get_publickey_hash(pubkey, SSH_PUBLICKEY_HASH_SHA256, @@ -320,28 +318,23 @@ static int check_host_key_knownhosts(BDRVSSHState *s, Error **errp) "host key does not match the one in known_hosts; this " "may be a possible attack"); } - goto out; + return -EINVAL; case SSH_KNOWN_HOSTS_OTHER: - ret = -EINVAL; error_setg(errp, "host key for this server not found, another type exists"); - goto out; + return -EINVAL; case SSH_KNOWN_HOSTS_UNKNOWN: - ret = -EINVAL; error_setg(errp, "no host key was found in known_hosts"); - goto out; + return -EINVAL; case SSH_KNOWN_HOSTS_NOT_FOUND: - ret = -ENOENT; error_setg(errp, "known_hosts file not found"); - goto out; + return -ENOENT; case SSH_KNOWN_HOSTS_ERROR: - ret = -EINVAL; error_setg(errp, "error while checking the host"); - goto out; + return -EINVAL; default: - ret = -EINVAL; error_setg(errp, "error while checking for known server (%d)", state); - goto out; + return -EINVAL; } #else /* !HAVE_LIBSSH_0_8 */ int state; @@ -355,40 +348,31 @@ static int check_host_key_knownhosts(BDRVSSHState *s, Error **errp) trace_ssh_check_host_key_knownhosts(); break; case SSH_SERVER_KNOWN_CHANGED: - ret = -EINVAL; error_setg(errp, "host key does not match the one in known_hosts; this " "may be a possible attack"); - goto out; + return -EINVAL; case SSH_SERVER_FOUND_OTHER: - ret = -EINVAL; error_setg(errp, "host key for this server not found, another type exists"); - goto out; + return -EINVAL; case SSH_SERVER_FILE_NOT_FOUND: - ret = -ENOENT; error_setg(errp, "known_hosts file not found"); - goto out; + return -ENOENT; case SSH_SERVER_NOT_KNOWN: - ret = -EINVAL; error_setg(errp, "no host key was found in known_hosts"); - goto out; + return -EINVAL; case SSH_SERVER_ERROR: - ret = -EINVAL; error_setg(errp, "server error"); - goto out; + return -EINVAL; default: - ret = -EINVAL; error_setg(errp, "error while checking for known server (%d)", state); - goto out; + return -EINVAL; } #endif /* !HAVE_LIBSSH_0_8 */ /* known_hosts checking successful. */ - ret = 0; - - out: - return ret; + return 0; } static unsigned hex2decimal(char ch) @@ -501,20 +485,18 @@ static int check_host_key(BDRVSSHState *s, SshHostKeyCheck *hkc, Error **errp) static int authenticate(BDRVSSHState *s, Error **errp) { - int r, ret; + int r; int method; /* Try to authenticate with the "none" method. */ r = ssh_userauth_none(s->session, NULL); if (r == SSH_AUTH_ERROR) { - ret = -EPERM; session_error_setg(errp, s, "failed to authenticate using none " "authentication"); - goto out; + return -EPERM; } else if (r == SSH_AUTH_SUCCESS) { /* Authenticated! */ - ret = 0; - goto out; + return 0; } method = ssh_userauth_list(s->session, NULL); @@ -527,23 +509,18 @@ static int authenticate(BDRVSSHState *s, Error **errp) if (method & SSH_AUTH_METHOD_PUBLICKEY) { r = ssh_userauth_publickey_auto(s->session, NULL, NULL); if (r == SSH_AUTH_ERROR) { - ret = -EINVAL; session_error_setg(errp, s, "failed to authenticate using " "publickey authentication"); - goto out; + return -EINVAL; } else if (r == SSH_AUTH_SUCCESS) { /* Authenticated! */ - ret = 0; - goto out; + return 0; } } - ret = -EPERM; error_setg(errp, "failed to authenticate using publickey authentication " "and the identities held by your ssh-agent"); - - out: - return ret; + return -EPERM; } static QemuOptsList ssh_runtime_opts = { From patchwork Mon Jan 6 18:23:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218347 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VwihmafX"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s3zp516Hz9sPn for ; Tue, 7 Jan 2020 05:33:26 +1100 (AEDT) Received: from localhost ([::1]:57778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXBr-0003Bx-OU for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:33:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45499) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4D-00029p-Vk for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4C-0004FY-RJ for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:29 -0500 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:42441) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4C-0004FG-NL; Mon, 06 Jan 2020 13:25:28 -0500 Received: by mail-qv1-xf41.google.com with SMTP id dc14so19417436qvb.9; Mon, 06 Jan 2020 10:25:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bPEopA2rGPiKlnwe7NwEEW5/buNpX4bBB0w0wRuIyWo=; b=VwihmafXyrVYQKAP1pZJKtR4hfs73lmSlCTxATzLXkFHVkupvup1ZQLLLiplJDqsQq bczTVaeiaZ4fDnBYDC8azWkuwM4uEx6INZLK3pkookVwygZbBOteZgBd5nFDXEG0BWaW o1S77n7u3WX2kZnhr/LV8l5clxTwAKoh8rVd711zrk5rono1U5aZjP+H1H5/+rPB0K5U dw8gWHKa1d6qlfDUZYM6aEQkZEo3eqSH/V8H6fL7i9Rg4RaRb+JBOAopejZ19h43YXe0 WA7h+D+gqR602cf0FMGl8ykZf+3Cjh3/G4HDEEXLmPKtF1lFtC/hNNnFMbxLh8F6VOgT ytZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bPEopA2rGPiKlnwe7NwEEW5/buNpX4bBB0w0wRuIyWo=; b=hZC+UXSMN/waHCpoNVPYUK8lspLBXVYx/pepyVHwuYcYOPbbcdpc10qMh9E2NCehxx Qk6xyyWOhbzR0Ly2Dh1ZfY7tNuHleTxcdM8YLh0EQpXp9SVsrb5Q7z5LY4+KCb2hUjyy t855hOmZy58G5lE8huWGwJHvCeN8XRK2GQR2B2JF5H3h1E/Bu0SlAdyU9MLIs9H0BYe9 c3VCb5ASNvgPmop9hwhi8yzdTtcrMuRJP+VcFZ0vPexmJO60/mnMsOpPpl+Tld3WR4BB DpyaRpHzKlpbtEc5qP9zkrYhu7CXuOJyq+0KrkSIZutHTZ6rHfMQa0nmtV7OnejF+ODV eWUQ== X-Gm-Message-State: APjAAAWnsj1MgOdil44OtfA9qcz7d0oA5MRYOxLJ1c27Zv4nzSC0eqnv aO8Z5RtJ/B2NSLs39VsfOwm77rZ0 X-Google-Smtp-Source: APXvYqzciuoVbabwwxlGIl13Ksj3vtokHbUWMVSjvO9RGjZcKpW4zNQZ5T9o2tbs6M1UcRLDoSfAdQ== X-Received: by 2002:a05:6214:1272:: with SMTP id r18mr51710568qvv.208.1578335128135; Mon, 06 Jan 2020 10:25:28 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:27 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 20/59] block/vpc.c: remove unneeded 'fail' label in create_dynamic_disk() Date: Mon, 6 Jan 2020 15:23:46 -0300 Message-Id: <20200106182425.20312-21-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f41 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kevin Wolf , Daniel Henrique Barboza , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'fail' label can be replaced by 'return ret' on error and 'return 0' in the end of the function. CC: Kevin Wolf CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- block/vpc.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index a65550298e..2678b48dfd 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -839,13 +839,13 @@ static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf, ret = blk_pwrite(blk, offset, buf, HEADER_SIZE, 0); if (ret < 0) { - goto fail; + return ret; } offset = 1536 + ((num_bat_entries * 4 + 511) & ~511); ret = blk_pwrite(blk, offset, buf, HEADER_SIZE, 0); if (ret < 0) { - goto fail; + return ret; } /* Write the initial BAT */ @@ -855,7 +855,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf, for (i = 0; i < DIV_ROUND_UP(num_bat_entries * 4, 512); i++) { ret = blk_pwrite(blk, offset, buf, 512, 0); if (ret < 0) { - goto fail; + return ret; } offset += 512; } @@ -882,12 +882,10 @@ static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf, ret = blk_pwrite(blk, offset, buf, 1024, 0); if (ret < 0) { - goto fail; + return ret; } - ret = 0; - fail: - return ret; + return 0; } static int create_fixed_disk(BlockBackend *blk, uint8_t *buf, From patchwork Mon Jan 6 18:23:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218382 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HogvO3OA"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4Tv1cVNz9sR4 for ; Tue, 7 Jan 2020 05:56:03 +1100 (AEDT) Received: from localhost ([::1]:58134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXXk-0007Sm-P8 for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:56:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45561) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4H-0002EF-9w for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4F-0004IB-Fx for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:33 -0500 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:44904) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4E-0004Gm-8c; Mon, 06 Jan 2020 13:25:31 -0500 Received: by mail-qt1-x843.google.com with SMTP id t3so43182952qtr.11; Mon, 06 Jan 2020 10:25:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a9jsk8u+/5hibvcbWneMzoArJdAq2nWhpUyUdOQCk1M=; b=HogvO3OAHqmXNQNWDvBqNkfr5eN91mMiemuxU5UdLdAjJb5muyyyIsEznFNTt9Ea+q DTZkVChOcIWsLAWQqKk/UWwC+Lk3NoJb15mgilFglc7lEbTlgS8aa/25SQhXW2fBpnnT jMOG101eQ8ICQw0/M1pnNwaHSGkq8EumOBxFM9lhm90unF4X4lxwZuYYP5L+F9MDLY7o Htg0NnhD6bYmxcCdUzAZdEcCNr7X76bnCQIWCl0q6am2rvW6HOzTZdnfR0KnMPbQUwb9 3ABKOU4DKFxLlB6BhhiQeQC3PvcMXP9o8YD6wqJB9owvrGbt74IXsR7pHe4kgstuo2iG cxig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a9jsk8u+/5hibvcbWneMzoArJdAq2nWhpUyUdOQCk1M=; b=XmWerVyY7t+rI5/XIsfLQxumeDa8loovgFfejZYHW0fss/O9eYwy+uPujIKLtFANm3 VNXz9DoXTm8rG/x+M+flW+uxAhBo1cNFuCS6eIAzEJPSMIknbkVrKHhSnzvVPTz2KLg+ b4g+c4QbHwe4VnZcw5aSjTjMWasTgRwnBFMq0/CGLbnwTerXR+2z92ZQlAgxCY5zQvu9 FqY9706vmTMd5zpgIAHPPpCVaIuY1LBfjgG3SSzS5htXohp3YokEeHDIqk06+qOHjvVc yg1iukMiQfJ+j5O3/BtbIRvL3N8bdc+xwgSh6ShitL2FulLwZHc277wFKlaYih/1/nzW MrcA== X-Gm-Message-State: APjAAAWEzrCFjVBPAp9SWETdbhFkIzyY0LC8sPBRwQ1BfWpNuwgIkdIU XWZko4veW7lli2OAAuYcBX8Kx7M+ X-Google-Smtp-Source: APXvYqzKjaRzSrLUDb5OgrpFLF8q43Lcha4CSMKbMWZawaidR3nbPVnUEDfKMRgcd9g1WNdLHGLAhw== X-Received: by 2002:aed:2be4:: with SMTP id e91mr77977865qtd.148.1578335129743; Mon, 06 Jan 2020 10:25:29 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:29 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 21/59] block/backup.c remove unneeded 'out' label in backup_run() Date: Mon, 6 Jan 2020 15:23:47 -0300 Message-Id: <20200106182425.20312-22-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , John Snow , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' can be replaced by 'return ret' and 'return -ECANCELED'. CC: John Snow CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- block/backup.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block/backup.c b/block/backup.c index cf62b1a38c..e73294872c 100644 --- a/block/backup.c +++ b/block/backup.c @@ -254,13 +254,12 @@ static int coroutine_fn backup_run(Job *job, Error **errp) for (offset = 0; offset < s->len; ) { if (yield_and_check(s)) { - ret = -ECANCELED; - goto out; + return -ECANCELED; } ret = block_copy_reset_unallocated(s->bcs, offset, &count); if (ret < 0) { - goto out; + return ret; } offset += count; @@ -284,7 +283,6 @@ static int coroutine_fn backup_run(Job *job, Error **errp) ret = backup_loop(s); } - out: return ret; } From patchwork Mon Jan 6 18:23:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218389 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pkqpqClA"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4Xv0n8Hz9sPK for ; Tue, 7 Jan 2020 05:58:39 +1100 (AEDT) Received: from localhost ([::1]:58185 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXaG-0002e5-FF for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:58:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45592) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4J-0002GJ-83 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4H-0004Ks-Ck for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:34 -0500 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:44903) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4H-0004Ik-8v; Mon, 06 Jan 2020 13:25:33 -0500 Received: by mail-qt1-x841.google.com with SMTP id t3so43183042qtr.11; Mon, 06 Jan 2020 10:25:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ETqO23SHWpPMRbtRK9xMCrBSsMXG0QNt/7zW03rA7Ew=; b=pkqpqClAAU65D8rWlHzvXBzNxtF8NFiKqQd/peZLcto6NN8X4vC011llPx805Cuh9j okgP2a4G55Vc75DZiwkkL7LflHQd6GUb8yTJh3JgzJFK8VPYgIwgWnnk/XhSHdcmKlLz VGPbSH3HIozEfeeyOmzCfu3r4rX1sZM7Gtbu8gHVpaPNnb5GI+Dx4yPA0478xOFxdBJ5 EWIXsbpNUZE7f4KX7YJcs7mTHE7LlmvthkL3BEauzAYAF4U1i1Xe7lSZQJR8lNvRtvTJ IrDfUiLViWdxs7Ve/1SHxdutDNjVuQVaHAT3NTQnPWxjr+fqcMo7DdHxDHDlmuWLT/o5 fLPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ETqO23SHWpPMRbtRK9xMCrBSsMXG0QNt/7zW03rA7Ew=; b=cxKVJ0LH+nXBX+7Gye5xO0QMhoCe0B7Mi9CR3abxOnLg97vMCKk5Obiq0dUJ9fUTg3 qQWgiODD48JO2G/oxGirhBIF8rmUj0rw/qAFk544Hmo9CnGrMuZCy2IWGE0/Qt0GXbei k3i6zdVXGN1DQJqeMeQb/UVI74hvG4bG2iZmbnO5mQGsslZ7eJ11tYCY49Zc84Q+j0yk w7bYdCnHu9QKwbPcS4JfTWy+rkRhIVN+/InK5b8dBV/zWIJc5fqEzNr7qJ7xv9uyCowl UIsqSEj0Vafy0fPZUhaAXe/T6W+STBn3qiOY2SpkBPs4ZYS068NQD63o74Ml/tW7JzIt eVjg== X-Gm-Message-State: APjAAAXkrtCBI6CbfgCU3qilZN+SrXLsddIVxms9nfj/P2Ql+Ae1znqE PHZU5uEyTPMdDyw/j8M7CoXN08+G X-Google-Smtp-Source: APXvYqwVAjtRACMUNbwLQSLwq35h9JtpfeE9y9G2e55OXgkDStnsckiZohcDDEa5GjF3ioEOBZ6VIw== X-Received: by 2002:ac8:5442:: with SMTP id d2mr78985485qtq.297.1578335131570; Mon, 06 Jan 2020 10:25:31 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:31 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 22/59] block/vmdk.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:23:48 -0300 Message-Id: <20200106182425.20312-23-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::841 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Fam Zheng , Daniel Henrique Barboza , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'exit' label from vmdk_open_desc_file() can be replaced by 'return' calls with the appropriate value. Same thing with the 'out' label from vmdk_co_create(). CC: Fam Zheng CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- block/vmdk.c | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 20e909d997..d1491486de 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1222,14 +1222,12 @@ out: static int vmdk_open_desc_file(BlockDriverState *bs, int flags, char *buf, QDict *options, Error **errp) { - int ret; char ct[128]; BDRVVmdkState *s = bs->opaque; if (vmdk_parse_description(buf, "createType", ct, sizeof(ct))) { error_setg(errp, "invalid VMDK image descriptor"); - ret = -EINVAL; - goto exit; + return -EINVAL; } if (strcmp(ct, "monolithicFlat") && strcmp(ct, "vmfs") && @@ -1238,14 +1236,11 @@ static int vmdk_open_desc_file(BlockDriverState *bs, int flags, char *buf, strcmp(ct, "twoGbMaxExtentSparse") && strcmp(ct, "twoGbMaxExtentFlat")) { error_setg(errp, "Unsupported image type '%s'", ct); - ret = -ENOTSUP; - goto exit; + return -ENOTSUP; } s->create_type = g_strdup(ct); s->desc_offset = 0; - ret = vmdk_parse_extents(buf, bs, options, errp); -exit: - return ret; + return vmdk_parse_extents(buf, bs, options, errp); } static int vmdk_open(BlockDriverState *bs, QDict *options, int flags, @@ -2738,7 +2733,6 @@ static BlockBackend *vmdk_co_create_cb(int64_t size, int idx, static int coroutine_fn vmdk_co_create(BlockdevCreateOptions *create_options, Error **errp) { - int ret; BlockdevCreateOptionsVmdk *opts; opts = &create_options->u.vmdk; @@ -2746,23 +2740,18 @@ static int coroutine_fn vmdk_co_create(BlockdevCreateOptions *create_options, /* Validate options */ if (!QEMU_IS_ALIGNED(opts->size, BDRV_SECTOR_SIZE)) { error_setg(errp, "Image size must be a multiple of 512 bytes"); - ret = -EINVAL; - goto out; + return -EINVAL; } - ret = vmdk_co_do_create(opts->size, - opts->subformat, - opts->adapter_type, - opts->backing_file, - opts->hwversion, - false, - opts->zeroed_grain, - vmdk_co_create_cb, - opts, errp); - return ret; - -out: - return ret; + return vmdk_co_do_create(opts->size, + opts->subformat, + opts->adapter_type, + opts->backing_file, + opts->hwversion, + false, + opts->zeroed_grain, + vmdk_co_create_cb, + opts, errp); } static void vmdk_close(BlockDriverState *bs) From patchwork Mon Jan 6 18:23:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218350 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="N8rxMvdH"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s43Z6L37z9sPK for ; Tue, 7 Jan 2020 05:36:42 +1100 (AEDT) Received: from localhost ([::1]:57822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXF2-0006tI-3o for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:36:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45615) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4K-0002JJ-BQ for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4J-0004MJ-7S for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:36 -0500 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:39824) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4I-0004L2-9O; Mon, 06 Jan 2020 13:25:34 -0500 Received: by mail-qt1-x843.google.com with SMTP id e5so43198338qtm.6; Mon, 06 Jan 2020 10:25:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y47zerruHLKnazd5IMxKseByHsW/6i/5CiO+7Hn42cc=; b=N8rxMvdHf4A/3o5xqX4MyRD1wroOF4aAuhBB9UIwOm8VXaGINh8qjaBdNp1INFvW2r yGP6D15XY0i+DiNbgLmSvQyy9d3KYt/2OxFG1IPmYy1tTMjHAv+tv2+Wn5v5Hwt6vKg1 lr8s5/OnNPsOdj+vEEQgQ+jsjdZ0mJvAkdYbu3jOBRZiR0jOVvLB+0BSKDyH4lMFHznQ 8gAI101vjjslILxFIuztIHU1A0zk7GK2z74u9S8MXHqZMxPsXBMTCRpoyOEss2nZq1LO /T2EfUe8qW0Bl4GFlFY7iYPgDDJXp23Z8XlHC21Y2+rB9BDgV1P3O8IYidxPUZjxdnSB ly7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y47zerruHLKnazd5IMxKseByHsW/6i/5CiO+7Hn42cc=; b=mZZnGzHp4A5pdNJshH0i81NOtibZ4YutejOt62Zw1GCMK18jRpDxxbgG2mGDEpg+21 MIz3sxNPRHDIjF2Hip5X5zqDy2Bjpysh431HWS0gESRntwoCnBlM6CKzM+6GMJlRFCAa nfQf5welkjVRC6L5Nsra9DvSef6UUv0rJufs+OSFlgYBLM8tfLhTCcQTQTaIL9qyu1Xf 6qFDjOzOZgRs7zplJaqNtkq0OZlYpWeNtn1o0PjsQdHxZeMuO9pet1ZsBk1cTJG3LZOY 4/f5ESglv0sSPEYcsqpxNoi0etFmyCgVOL3aIto2XHfkv16/xu5ozeHZSdnClt79J/iJ Sb+g== X-Gm-Message-State: APjAAAXioV5bpUgsyz7iTZx+wrNVq9AkQbWaQaOEj6CUXz3Qh2ZS3dfa HKvUGgjHidkdoRAee9vG3Ja/b0Gv X-Google-Smtp-Source: APXvYqxOJvAIFe2aON1mojikbvIS4MLMgIN8ozVRuscfhAULtmFMGA9/PLVL5pjm5WirxAR4821FrQ== X-Received: by 2002:ac8:490f:: with SMTP id e15mr72868547qtq.32.1578335133194; Mon, 06 Jan 2020 10:25:33 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:32 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 23/59] block/vxhs.c: remove unneeded 'out' label in vxhs_iio_callback() Date: Mon, 6 Jan 2020 15:23:49 -0300 Message-Id: <20200106182425.20312-24-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kevin Wolf , Daniel Henrique Barboza , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' is just a 'return' call. CC: Kevin Wolf CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- block/vxhs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/block/vxhs.c b/block/vxhs.c index d79fc97df6..e3db367918 100644 --- a/block/vxhs.c +++ b/block/vxhs.c @@ -96,7 +96,7 @@ static void vxhs_iio_callback(void *ctx, uint32_t opcode, uint32_t error) acb = ctx; } else { trace_vxhs_iio_callback(error); - goto out; + return; } if (error) { @@ -122,8 +122,6 @@ static void vxhs_iio_callback(void *ctx, uint32_t opcode, uint32_t error) } break; } -out: - return; } static QemuOptsList runtime_opts = { From patchwork Mon Jan 6 18:23:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218351 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Nu0kKN/m"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s44569vkz9sPK for ; Tue, 7 Jan 2020 05:37:08 +1100 (AEDT) Received: from localhost ([::1]:57842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXFR-0007bT-K4 for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:37:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45648) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4L-0002LW-Jh for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4K-0004N6-0o for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:37 -0500 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:39292) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4J-0004Mk-SN; Mon, 06 Jan 2020 13:25:35 -0500 Received: by mail-qv1-xf43.google.com with SMTP id y8so19431485qvk.6; Mon, 06 Jan 2020 10:25:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1eNWCesezoeCHU4P6XXmYWzX+KWcO3wBsevjsS6K9fg=; b=Nu0kKN/mxLka/H/3rWIpQbIG6c9bN9JQ85u2Z01T8cvkL4gjy7BxQihZSMLpMLUklq Vqg76xrZlnb6wmDKUUeUpvbQxFZGd7JmKMFdPj/VoIBcDhCxEiqfSGd1GoEyroFDgFJa tHjY0lqU+XOQd458ZLr/EQO1Bd83NFE9CXCgZitBjxwJWZFXwkkkOm7ih9cBnxX6NmmN QgQa6CuISUm9Q9ntrKJAumoUi5MvmEryIh0IBODnTON0O8LSvTfaQpBivcbtLiz2EslZ ZQlRgJmQApUN06vFTQ1mfpGL9YGXImbdAHMkX0U07th7TSBEQLn2TV78jtUED5fwTRRd /kMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1eNWCesezoeCHU4P6XXmYWzX+KWcO3wBsevjsS6K9fg=; b=LEOxwHVuSspPIi63ArFbaQeqUDQvoLDg1Pb0Y4ZXdluk1eqMRLOhdatFP31MkMPxtJ krydVUgiDrsgm27MJZnrc9308Y4ZNZrQRuvGSD010anZraZplOPjf5dEqQOMinQoLgun GOlTts6o1gLvgVv/7PYmZGAhWRIap2UVW+c4RqtUHgVTqYGmkvbgZqSTyC3NsmbIq9GM 0JwTHC3iXuCvxPLxhPfK/kHTouHPU3wja9uGtjv3mHpI/g8SYxurA0TcaDD5hN7oUVG/ SvVtASKJmmSPyAhY2+LWNR+l4IaTwB8jg8ixk2jTyVggpSenpXIKDzOuV9fM5jQKKpzz z2bQ== X-Gm-Message-State: APjAAAXJvaITTws1rQX41Fwdeh3ddLk+QhdBVxrDd/zXtpAO7RVxWyg4 TENyIcypMEGFBubH4/tVhkCp4Xub X-Google-Smtp-Source: APXvYqw9VquKkGWHrF4hZ6jV1CoCcGb2PRdGGrSSPEADPaUlEEOsRNz2cwqWfgIdzM0AbV/oVRUjgw== X-Received: by 2002:a0c:fa87:: with SMTP id o7mr81007061qvn.160.1578335135150; Mon, 06 Jan 2020 10:25:35 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:34 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 24/59] block/vhdx-log.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:23:50 -0300 Message-Id: <20200106182425.20312-25-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f43 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Jeff Cody , Daniel Henrique Barboza , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Removing some 'exit' labels used in some functions that are unneeded, changing them for the adequate 'return' value for the context. CC: Jeff Cody CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- block/vhdx-log.c | 86 ++++++++++++++++++------------------------------ 1 file changed, 32 insertions(+), 54 deletions(-) diff --git a/block/vhdx-log.c b/block/vhdx-log.c index 13a49c2a33..ba89f0adc6 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -64,8 +64,7 @@ static int vhdx_log_peek_hdr(BlockDriverState *bs, VHDXLogEntries *log, /* peek is only supported on sector boundaries */ if (log->read % VHDX_LOG_SECTOR_SIZE) { - ret = -EFAULT; - goto exit; + return -EFAULT; } read = log->read; @@ -77,19 +76,17 @@ static int vhdx_log_peek_hdr(BlockDriverState *bs, VHDXLogEntries *log, } if (read == log->write) { - ret = -EINVAL; - goto exit; + return -EINVAL; } offset = log->offset + read; ret = bdrv_pread(bs->file, offset, hdr, sizeof(VHDXLogEntryHeader)); if (ret < 0) { - goto exit; + return ret; } vhdx_log_entry_hdr_le_import(hdr); -exit: return ret; } @@ -179,7 +176,7 @@ static int vhdx_log_write_sectors(BlockDriverState *bs, VHDXLogEntries *log, ret = vhdx_user_visible_write(bs, s); if (ret < 0) { - goto exit; + return ret; } write = log->write; @@ -196,7 +193,7 @@ static int vhdx_log_write_sectors(BlockDriverState *bs, VHDXLogEntries *log, ret = bdrv_pwrite(bs->file, offset, buffer_tmp, VHDX_LOG_SECTOR_SIZE); if (ret < 0) { - goto exit; + return ret; } buffer_tmp += VHDX_LOG_SECTOR_SIZE; @@ -205,7 +202,6 @@ static int vhdx_log_write_sectors(BlockDriverState *bs, VHDXLogEntries *log, num_sectors--; } -exit: return ret; } @@ -214,42 +210,37 @@ exit: static bool vhdx_log_hdr_is_valid(VHDXLogEntries *log, VHDXLogEntryHeader *hdr, BDRVVHDXState *s) { - int valid = false; - if (hdr->signature != VHDX_LOG_SIGNATURE) { - goto exit; + return false; } /* if the individual entry length is larger than the whole log * buffer, that is obviously invalid */ if (log->length < hdr->entry_length) { - goto exit; + return false; } /* length of entire entry must be in units of 4KB (log sector size) */ if (hdr->entry_length % (VHDX_LOG_SECTOR_SIZE)) { - goto exit; + return false; } /* per spec, sequence # must be > 0 */ if (hdr->sequence_number == 0) { - goto exit; + return false; } /* log entries are only valid if they match the file-wide log guid * found in the active header */ if (!guid_eq(hdr->log_guid, s->headers[s->curr_header]->log_guid)) { - goto exit; + return false; } if (hdr->descriptor_count * sizeof(VHDXLogDescriptor) > hdr->entry_length) { - goto exit; + return false; } - valid = true; - -exit: - return valid; + return true; } /* @@ -274,10 +265,10 @@ static bool vhdx_log_desc_is_valid(VHDXLogDescriptor *desc, bool ret = false; if (desc->sequence_number != hdr->sequence_number) { - goto exit; + return false; } if (desc->file_offset % VHDX_LOG_SECTOR_SIZE) { - goto exit; + return false; } if (desc->signature == VHDX_LOG_ZERO_SIGNATURE) { @@ -290,7 +281,6 @@ static bool vhdx_log_desc_is_valid(VHDXLogDescriptor *desc, ret = true; } -exit: return ret; } @@ -347,20 +337,18 @@ static int vhdx_log_read_desc(BlockDriverState *bs, BDRVVHDXState *s, ret = vhdx_log_peek_hdr(bs, log, &hdr); if (ret < 0) { - goto exit; + return ret; } if (vhdx_log_hdr_is_valid(log, &hdr, s) == false) { - ret = -EINVAL; - goto exit; + return -EINVAL; } desc_sectors = vhdx_compute_desc_sectors(hdr.descriptor_count); desc_entries = qemu_try_blockalign(bs->file->bs, desc_sectors * VHDX_LOG_SECTOR_SIZE); if (desc_entries == NULL) { - ret = -ENOMEM; - goto exit; + return -ENOMEM; } ret = vhdx_log_read_sectors(bs, log, §ors_read, desc_entries, @@ -390,11 +378,10 @@ static int vhdx_log_read_desc(BlockDriverState *bs, BDRVVHDXState *s, } *buffer = desc_entries; - goto exit; + return ret; free_and_exit: qemu_vfree(desc_entries); -exit: return ret; } @@ -688,7 +675,7 @@ static int vhdx_log_search(BlockDriverState *bs, BDRVVHDXState *s, ret = vhdx_validate_log_entry(bs, s, &curr_log, curr_seq, &seq_valid, &hdr); if (ret < 0) { - goto exit; + return ret; } if (seq_valid) { @@ -704,7 +691,7 @@ static int vhdx_log_search(BlockDriverState *bs, BDRVVHDXState *s, ret = vhdx_validate_log_entry(bs, s, &curr_log, curr_seq, &seq_valid, &hdr); if (ret < 0) { - goto exit; + return ret; } if (seq_valid == false) { break; @@ -735,8 +722,6 @@ static int vhdx_log_search(BlockDriverState *bs, BDRVVHDXState *s, s->log.sequence = candidate.hdr.sequence_number + 1; } - -exit: return ret; } @@ -766,29 +751,26 @@ int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed, if (s->log.offset < VHDX_LOG_MIN_SIZE || s->log.offset % VHDX_LOG_MIN_SIZE) { - ret = -EINVAL; - goto exit; + return -EINVAL; } /* per spec, only log version of 0 is supported */ if (hdr->log_version != 0) { - ret = -EINVAL; - goto exit; + return -EINVAL; } /* If either the log guid, or log length is zero, * then a replay log is not present */ if (guid_eq(hdr->log_guid, zero_guid)) { - goto exit; + return 0; } if (hdr->log_length == 0) { - goto exit; + return 0; } if (hdr->log_length % VHDX_LOG_MIN_SIZE) { - ret = -EINVAL; - goto exit; + return -EINVAL; } @@ -797,13 +779,12 @@ int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed, ret = vhdx_log_search(bs, s, &logs); if (ret < 0) { - goto exit; + return ret; } if (logs.valid) { if (bs->read_only) { bdrv_refresh_filename(bs); - ret = -EPERM; error_setg(errp, "VHDX image file '%s' opened read-only, but " "contains a log that needs to be replayed", @@ -811,18 +792,16 @@ int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed, error_append_hint(errp, "To replay the log, run:\n" "qemu-img check -r all '%s'\n", bs->filename); - goto exit; + return -EPERM; } /* now flush the log */ ret = vhdx_log_flush(bs, s, &logs); if (ret < 0) { - goto exit; + return ret; } *flushed = true; } - -exit: return ret; } @@ -1048,29 +1027,28 @@ int vhdx_log_write_and_flush(BlockDriverState *bs, BDRVVHDXState *s, * on disk, before creating log entry */ ret = bdrv_flush(bs); if (ret < 0) { - goto exit; + return ret; } ret = vhdx_log_write(bs, s, data, length, offset); if (ret < 0) { - goto exit; + return ret; } logs.log = s->log; /* Make sure log is stable on disk */ ret = bdrv_flush(bs); if (ret < 0) { - goto exit; + return ret; } ret = vhdx_log_flush(bs, s, &logs); if (ret < 0) { - goto exit; + return ret; } s->log = logs.log; -exit: return ret; } From patchwork Mon Jan 6 18:23:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218398 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="vgvSkeeO"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4cl264Rz9sPn for ; Tue, 7 Jan 2020 06:01:59 +1100 (AEDT) Received: from localhost ([::1]:58248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXdU-0006qs-Kc for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:01:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45679) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4M-0002NS-QF for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4L-0004PA-PU for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:38 -0500 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:38121) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4L-0004On-LO; Mon, 06 Jan 2020 13:25:37 -0500 Received: by mail-qk1-x744.google.com with SMTP id k6so40296963qki.5; Mon, 06 Jan 2020 10:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PKYZ0M4t+5Cvodu2K02JYtC//F3gaNkUYi3Ckm33kDw=; b=vgvSkeeOFCOWiENjxBXP+qbzb6eNuk+3D7Q6fYet0qFgaDfGM9sD3FyHyi0t9i1AG0 qIXDU0dBHuKSA/RNyWMbNviS/3e89GH3uuyyOdGfeXccgCOinZL0AGDFQBSphX4HGbGn Xk+HHkS6Ygvyh0HqGzXRXQuF+FXxIGmj4K4MfehzTYK2QTd8irx2suv00wTl7FLpS39o vZzgvBWStF6P1AOrGBuUwpOxzfC0+ZiUkccB3n4ys+laWqT1ysKC1Qjgab5cHQmR0wLx yChLWGqTvsMlgZK9NZdjuLMbBr+DSBNM69R0tw27GUqI4rLZLiBWf+Kuq3PPfBPczZj4 kLAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PKYZ0M4t+5Cvodu2K02JYtC//F3gaNkUYi3Ckm33kDw=; b=q9WFH9HUN+1Inu5WMOnhE9Kyqf6fDclwku5hGQ1wwYcmkXjDuAVUG0/OeVh12Mb3eo TLqVu0v9jnlGwMFj9ayFaqw/CBuF0/IWLrZ8+7So+iOgimHZOuC4aAep99U60sYH3CWT /Mkp3MDzwuSfY0HnwD6Wf4blVnB3fmcD+xrKsjApsORVk1GUnDD+MxB3Jh74CILtb1Nl T1saOzY2QlT1PikIwU8NmgjuGaqRlYixXSHNjdXByMU0qzc5cRt8BckGA6iSQQYlr3F3 6+tMIduUNm5UyFGmcAjP3MLKirz7uqq/YSf4Db84H/Td//Gh/8bimHo3GdbRGohrOAWB y0qg== X-Gm-Message-State: APjAAAVUKCi3esE/HH2ZCxzUpGb1RLhUMHiIcMJq6I/agL7K2VYXjJGa 7GdGTB9D9wi7fC83WZCdajSoCuzN X-Google-Smtp-Source: APXvYqyHPrK96/xFK20pSP76AtA0O9Douwyua786EZfCF4dVv9Ptbi5dJPEGq9kPIygFyrbrybdiSA== X-Received: by 2002:a37:9f41:: with SMTP id i62mr81732449qke.272.1578335137004; Mon, 06 Jan 2020 10:25:37 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:36 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 25/59] block/vhdx.c: remove unneeded 'exit' labels Date: Mon, 6 Jan 2020 15:23:51 -0300 Message-Id: <20200106182425.20312-26-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Jeff Cody , Daniel Henrique Barboza , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'exit' label of vhdx_region_check() and vhdx_update_header() can be replaced by 'return' statements. CC: Jeff Cody CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- block/vhdx.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/block/vhdx.c b/block/vhdx.c index f02d2611be..7a1ea312ed 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -229,7 +229,6 @@ void vhdx_guid_generate(MSGUID *guid) /* Check for region overlaps inside the VHDX image */ static int vhdx_region_check(BDRVVHDXState *s, uint64_t start, uint64_t length) { - int ret = 0; uint64_t end; VHDXRegionEntry *r; @@ -239,13 +238,11 @@ static int vhdx_region_check(BDRVVHDXState *s, uint64_t start, uint64_t length) error_report("VHDX region %" PRIu64 "-%" PRIu64 " overlaps with " "region %" PRIu64 "-%." PRIu64, start, end, r->start, r->end); - ret = -EINVAL; - goto exit; + return -EINVAL; } } -exit: - return ret; + return 0; } /* Register a region for future checks */ @@ -390,11 +387,10 @@ static int vhdx_update_header(BlockDriverState *bs, BDRVVHDXState *s, ret = vhdx_write_header(bs->file, inactive_header, header_offset, true); if (ret < 0) { - goto exit; + return ret; } s->curr_header = hdr_idx; -exit: return ret; } From patchwork Mon Jan 6 18:23:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218354 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OV2233OK"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s46d39skz9sPK for ; Tue, 7 Jan 2020 05:39:21 +1100 (AEDT) Received: from localhost ([::1]:57878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXHa-0002tH-SW for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:39:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45731) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4P-0002R3-5p for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4N-0004Qv-Md for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:40 -0500 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:40605) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4N-0004QZ-J4; Mon, 06 Jan 2020 13:25:39 -0500 Received: by mail-qt1-x843.google.com with SMTP id e6so43208219qtq.7; Mon, 06 Jan 2020 10:25:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q+bOzXBEsI8nNVkaMppRn/FCllRO/uVUk7UDRcJPDvc=; b=OV2233OKuf+rUsSvB+iilCKEFGrWOy30+te8ooCAwZfPiQbGkPvIcW7BN1GG/za4ih cG8Hwbz2L+lM8fUdGGzKGAo8m7vRhI3y+w/74n0UNzgn/e00j1Fv+1Celw1U4qvaM6QH vMh/K2VavxGGJ8lA5Fwf1lMvQ38SXE7l0wjzP64uT8Q634whU6l57KsB7QTcJDhFSH+o UAValYXfUXAAxNVmTpURArStt+68P+KPHScLU3uPIULXRy5IizI8LSq2sHxfKv65qFeI NxZXQ9NFV9DwP3UFgH1qaQiCyrtYaUbmPyUYuPdloUFr+krHdH5jgbCmIyRDYUlxrEZ8 9+aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q+bOzXBEsI8nNVkaMppRn/FCllRO/uVUk7UDRcJPDvc=; b=lyXaVuapamFRMGWZaSRD+I3/sVBhl+8PyZ5p+p/REEN3jCDDYP2WKaPzl91P8pssoZ 1uEZrsB9kuLwPs1pNQPUnQOshAnUYYJs/tEKZ37Ho/xZ+ZHRiiJXqbofLyNOukB4sdqK eO5pFRph1sm8NW8lLd+HD247cnH1KL54ygQgxJH9H0B1ksakbu/qt4EREodBvA4qhaj7 B8R+29WJF00zXeX/haY8CJ5054zoey1tLcaSdyIB3JVpCE9U4kfpVBgvLxZwWjoJMJEz hJpPTOo/rM2AIYtCTGaL/sTHgQZb2wlFrZGGJ62ohL4GkQJJ4YrT4bxUQI3FGO35aNml Eb6Q== X-Gm-Message-State: APjAAAVWLGR8dNA0p7h23vjiiLlmKA958ZRfTwsdMVwzZN/Bc/EApisv pzPMVOZBB+I9JVGYgNhFfrgiGHZ9 X-Google-Smtp-Source: APXvYqyh5mMSZQ3pxp9i2UhaMKhzyAq85dan9+Qp2AUbce0/Y7zG4ocvzlPpaOwU8tebgr9Uv32NCQ== X-Received: by 2002:ac8:21ae:: with SMTP id 43mr77471513qty.223.1578335139073; Mon, 06 Jan 2020 10:25:39 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:38 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 26/59] block/replication.c: remove unneeded label in replication_co_writev Date: Mon, 6 Jan 2020 15:23:52 -0300 Message-Id: <20200106182425.20312-27-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Wen Congyang , Xie Changlong , Daniel Henrique Barboza Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The label 'out' in replication_co_writev() can be replaced by 'return ret'. The other label, 'out1', was renamed to 'out' since the original 'out' label was removed. CC: Wen Congyang CC: Xie Changlong Signed-off-by: Daniel Henrique Barboza --- block/replication.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/replication.c b/block/replication.c index 99532ce521..3d5eb64d41 100644 --- a/block/replication.c +++ b/block/replication.c @@ -258,7 +258,7 @@ static coroutine_fn int replication_co_writev(BlockDriverState *bs, assert(!flags); ret = replication_get_io_status(s); if (ret < 0) { - goto out; + return ret; } if (ret == 0) { @@ -280,7 +280,7 @@ static coroutine_fn int replication_co_writev(BlockDriverState *bs, remaining_sectors * BDRV_SECTOR_SIZE, &count); if (ret < 0) { - goto out1; + goto out; } assert(QEMU_IS_ALIGNED(count, BDRV_SECTOR_SIZE)); @@ -292,7 +292,7 @@ static coroutine_fn int replication_co_writev(BlockDriverState *bs, ret = bdrv_co_pwritev(target, sector_num * BDRV_SECTOR_SIZE, n * BDRV_SECTOR_SIZE, &hd_qiov, 0); if (ret < 0) { - goto out1; + goto out; } remaining_sectors -= n; @@ -300,9 +300,8 @@ static coroutine_fn int replication_co_writev(BlockDriverState *bs, bytes_done += count; } -out1: - qemu_iovec_destroy(&hd_qiov); out: + qemu_iovec_destroy(&hd_qiov); return ret; } From patchwork Mon Jan 6 18:23:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218358 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X1gKjg8P"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s49g6KgLz9sNH for ; Tue, 7 Jan 2020 05:41:59 +1100 (AEDT) Received: from localhost ([::1]:57940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXK9-0006VG-9z for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:41:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45764) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4Q-0002TH-Pc for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4P-0004TI-NN for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:42 -0500 Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]:40866) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4P-0004Sr-Jq; Mon, 06 Jan 2020 13:25:41 -0500 Received: by mail-qk1-x735.google.com with SMTP id c17so40290906qkg.7; Mon, 06 Jan 2020 10:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5cBjVRTpORMTQVS8zXhW7QTuSicvsXs51ybQld+rw8U=; b=X1gKjg8PQhYPv5gcSNzBZPcGOjMWmJ4yS8Ffu/1zmXHxJcXeNGvb62g73d8cyJMzXk gUa1mznTs1qvuP6ot1jQ5iBQ1aTndK13gojoefCM/jLxSUeVjgLwzDruRIZClOfDlehW u0/sdxFTcfYqrD23E0BFIXcTRQDkfUz6jWXbDIRpJ4UBcJ4/9MbrAbaGmYHTjZ2ZtgHe a/9gSoghL4JsgW63lfIrqtPpe2uyZ9huUFjhiCcF2JLh+4F+xBcjwFh8L0YZDmWbieis ORXOhLxFO4tn/IGG5jOT+/QdTaOeG5WSxXvt1o2q1PBzViWW8mgt3WSjrkxMF+NseBjO EqfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5cBjVRTpORMTQVS8zXhW7QTuSicvsXs51ybQld+rw8U=; b=Nt3YxGW01+tnU0F4to7Bn8EqjGGXK/mzZd6z5L9KQq+1Y3i4DemWYcpykm81Mhup7G Ia0iLMyi86oPbxedVzEfRFBaps8Wt821UeUkJAbTqtnQU7ExSi0G5iHxdpgnqbRs901o 2+IOqV3bITszc7yNW9IrMJH9vdvmjqJ9ZZyohHz45hOQNo95FMtOMv51DWcW4PuXMv33 /+QyYx0dt8qJv2w4PfHhzl12rQUhCr/QgT51rGRUGOeLF0qaNHek5nRdr7chMzpu0fnO J+7HOaJnXJhh6xiIeej9Kncgfi8b2sd1i42tSwq6k58a9W9afsNQ5qRBzVzRnBNYbaoS 1Ijg== X-Gm-Message-State: APjAAAWBVcVo2f29mkyPUerAPN+8XzTjSOTBPa7J+yO/QEUb5GBxx26M kH3VGKG80pXTpwMErt6zhE+XD30M X-Google-Smtp-Source: APXvYqxedHDi5UiIn6Ox/FRAahaP05DzZ24yJxrpBkoIXp/fo+o0u+VfbhhfxtEQK5ufObtyaj2sHw== X-Received: by 2002:a05:620a:1eb:: with SMTP id x11mr85685346qkn.254.1578335140987; Mon, 06 Jan 2020 10:25:40 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:40 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 27/59] crypto/block-luks.c: remove unneeded label in qcrypto_block_luks_find_key Date: Mon, 6 Jan 2020 15:23:53 -0300 Message-Id: <20200106182425.20312-28-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::735 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kevin Wolf , Daniel Henrique Barboza , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'error' can be replaced by 'return -1' directly. CC: Kevin Wolf CC: Max Reitz CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- crypto/block-luks.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crypto/block-luks.c b/crypto/block-luks.c index 4861db810c..9742d4bdd9 100644 --- a/crypto/block-luks.c +++ b/crypto/block-luks.c @@ -1057,7 +1057,7 @@ qcrypto_block_luks_find_key(QCryptoBlock *block, opaque, errp); if (rv < 0) { - goto error; + return -1; } if (rv == 1) { return 0; @@ -1065,7 +1065,6 @@ qcrypto_block_luks_find_key(QCryptoBlock *block, } error_setg(errp, "Invalid password, cannot unlock any keyslot"); - error: return -1; } From patchwork Mon Jan 6 18:23:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218414 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aCigGM45"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4hS2XrSz9sR4 for ; Tue, 7 Jan 2020 06:05:12 +1100 (AEDT) Received: from localhost ([::1]:58314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXgb-0002Lo-QK for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:05:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45811) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4S-0002X8-Sw for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4R-0004VU-MJ for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:44 -0500 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]:41776) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4R-0004VB-Ia; Mon, 06 Jan 2020 13:25:43 -0500 Received: by mail-qk1-x72b.google.com with SMTP id x129so40277788qke.8; Mon, 06 Jan 2020 10:25:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Adi6YmWzd5BlIyjySU/FHh29puafqwS6MyW1XVUsuis=; b=aCigGM45Roe/Nr1ZXPjbYM8Xz0GSFXDL5YrXrdeaqunEB+OI3Y2LN/2I5bPMtc5S8j CGMl++arbFq6+4W/1Q33RBV8me0qDj45oXKxyynzYylUQnuirH625VTao0ior+8O3qFz xIN4ehhT7CuPe+exRMgisa4ERBUk5Fyfv7wN9eqZEvjeCUXVXHs2zFK4EW5LgBgQGgDF p+tQzfTuoWQNk0l4xKS44jJE2a/ik0xT352iQsjb6V7RhWs7FCkfZBlQNDsAAU/zjGxu zl+jk5tZ7tXYfIiTIlZb4glU0uA69gLjeZNo3bgkwJKmZEbEjEO8+wU2ywCNKD0kvRiZ Y9rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Adi6YmWzd5BlIyjySU/FHh29puafqwS6MyW1XVUsuis=; b=Vi54n9HzxSjjZja4aeMs2cWOWaNPxqHHeE0K7ReddM/v/3HWjFo+UNrJFO94oBo6rn 8LjL+Jafo9/8MB8jJ/Qbia85OfOBA8Ur7fDlMkvMID5CLCiCW48xRi0jEUDyzUorJlD2 O7T/Q1RRT+1rwjaezDlECLUCQxefKNPlL/wYS2ZhUiWNtD9KHfKVWhbuVjghAb1VFC/K Q8v5rTQKrBEllLMfr0oG9N48DtoS43oJxbDaeb8rEeF6BW8Czq6pVY8yHCW4BxQYUt75 hz+ZfQrOnJ+zVN+2uJHB3si6SYq+ABHC8ZRqW8DZVZ8r8AwSF92kzMS+9Aoz5R/7PGZW 82nA== X-Gm-Message-State: APjAAAXgY8GzOA2N8+OZ5+X5jrK9qiSsDkklwJCsOgGlZoEA63CKQRXz /UPpSJ5IUSIFXDKoFP82gv4AylND X-Google-Smtp-Source: APXvYqy9uuY+g/FFOUyP/GV4GYpoqMkRy1st8SV0/XE9bt2uTfjdO1LUISMtE5C85hik3nZV78SaHg== X-Received: by 2002:ae9:f711:: with SMTP id s17mr83111219qkg.238.1578335142878; Mon, 06 Jan 2020 10:25:42 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:42 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 28/59] qga/commands-win32.c: remove 'out' label in get_pci_info Date: Mon, 6 Jan 2020 15:23:54 -0300 Message-Id: <20200106182425.20312-29-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::72b X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Stefan Weil , Daniel Henrique Barboza Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' can be replaced by 'return pci' instead. CC: Stefan Weil Signed-off-by: Daniel Henrique Barboza --- qga/commands-win32.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 2461fd19bf..c520a341df 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -513,7 +513,7 @@ static GuestPCIAddress *get_pci_info(int number, Error **errp) DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); if (dev_info == INVALID_HANDLE_VALUE) { error_setg_win32(errp, GetLastError(), "failed to get devices tree"); - goto out; + return pci; } g_debug("enumerating devices"); @@ -584,7 +584,7 @@ static GuestPCIAddress *get_pci_info(int number, Error **errp) } else { error_setg_win32(errp, GetLastError(), "failed to get device instance ID"); - goto out; + return pci; } } @@ -598,14 +598,14 @@ static GuestPCIAddress *get_pci_info(int number, Error **errp) g_error("CM_Locate_DevInst failed with code %lx", cr); error_setg_win32(errp, GetLastError(), "failed to get device instance"); - goto out; + return pci; } cr = CM_Get_Parent(&parent_dev_inst, dev_inst, 0); if (cr != CR_SUCCESS) { g_error("CM_Get_Parent failed with code %lx", cr); error_setg_win32(errp, GetLastError(), "failed to get parent device instance"); - goto out; + return pci; } cr = CM_Get_Device_ID_Size(&dev_id_size, parent_dev_inst, 0); @@ -613,7 +613,7 @@ static GuestPCIAddress *get_pci_info(int number, Error **errp) g_error("CM_Get_Device_ID_Size failed with code %lx", cr); error_setg_win32(errp, GetLastError(), "failed to get parent device ID length"); - goto out; + return pci; } ++dev_id_size; @@ -628,7 +628,7 @@ static GuestPCIAddress *get_pci_info(int number, Error **errp) g_error("CM_Get_Device_ID failed with code %lx", cr); error_setg_win32(errp, GetLastError(), "failed to get parent device ID"); - goto out; + return pci; } } @@ -642,14 +642,14 @@ static GuestPCIAddress *get_pci_info(int number, Error **errp) if (parent_dev_info == INVALID_HANDLE_VALUE) { error_setg_win32(errp, GetLastError(), "failed to get parent device"); - goto out; + return pci; } parent_dev_info_data.cbSize = sizeof(SP_DEVINFO_DATA); if (!SetupDiEnumDeviceInfo(parent_dev_info, 0, &parent_dev_info_data)) { error_setg_win32(errp, GetLastError(), "failed to get parent device data"); - goto out; + return pci; } for (j = 0; @@ -731,7 +731,6 @@ static GuestPCIAddress *get_pci_info(int number, Error **errp) free_dev_info: SetupDiDestroyDeviceInfoList(dev_info); -out: return pci; } From patchwork Mon Jan 6 18:23:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218356 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DORwoTJX"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s48805WCz9sPK for ; Tue, 7 Jan 2020 05:40:40 +1100 (AEDT) Received: from localhost ([::1]:57898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXIr-0004dL-JA for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:40:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45837) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4U-0002Zy-HY for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4T-0004X4-Bq for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:46 -0500 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:44907) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4T-0004Wp-8I; Mon, 06 Jan 2020 13:25:45 -0500 Received: by mail-qt1-x843.google.com with SMTP id t3so43183563qtr.11; Mon, 06 Jan 2020 10:25:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MbtlCtBPgzqoGr8mUx8uII1CR9SSU0AvNsp1PJ3n1Aw=; b=DORwoTJXuE+VEhA22rmb5ertrcQheAF+szdeA/wGUNHxxKnamMDt8mRrrsJ6mJkiT3 wKSx8+Cq/3PnnQRHKclMoXRz17zvGcyNRUqLba3lQvEjdeEQjjvf1ulcnsODh4TRz+Yx N1mYIlPx7eHSnxvSCFecSThkdRGuw/7ayXB47wtZabqFVF1BNi/VBPJO9XmaFAZ3xsbF Ay5OApQh/ce0NN1xHJkSDew0ldGnQluXbMJbE4S04iP7oYYUFY8l0DX7y2b3oS3tAdjC Lpws/XX14RY2vG++zCmrt4t9zaRYlIS/VHmIAIYzAsKpP62XCDMHjvmHKPS+g4dkoNDU CObA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MbtlCtBPgzqoGr8mUx8uII1CR9SSU0AvNsp1PJ3n1Aw=; b=mxnwQ8T6xo4unOVnLOYjkzMpvRPIk3FpzPnhWONZ3JAz63TbR2l1ASLLb8SWY5eytG buHwZLftMH4EAVgk2c9eKL3vHLzgNZ9++llgoZ0x4OB0u3MONqgCmMYFKm5Yo3lF0a7J IicbYVNi89WwLHLNXYjMMM/30nl+MLnyn8gVE5CB+RbS/ZhC9gSJKpUn4nHSE/pEMMv5 emDqItYSgH7AGt5uxipi9bGxpOPdadHCizrbWGNGDbHQvVt3W1nr65SUGLlF8iH93pa5 7pXhqZ+p2zw6MxDZQgdar2CC2oFGDdgeuBKWqh6FxiPZDxLh6lp/Yce+gp7E8mWp92py Nhtw== X-Gm-Message-State: APjAAAUfhdDkvxklY3DFgzCNWksC7IP3rUuuDSqrHNgspZi3bp4l+W3y KNvKXueeKHIuGzmvF7OarMteg/uq X-Google-Smtp-Source: APXvYqxj7atGmegCHcM6OKfS6yo7/T+5qulOAvhmTYb6RVIuOMkEHi/QvaWyslbN1EGCvIi+61xJBw== X-Received: by 2002:aed:2be4:: with SMTP id e91mr77978661qtd.148.1578335144732; Mon, 06 Jan 2020 10:25:44 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:44 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 29/59] cryptodev-vhost.c: remove unneeded 'err' label in cryptodev_vhost_start Date: Mon, 6 Jan 2020 15:23:55 -0300 Message-Id: <20200106182425.20312-30-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Gonglei Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'err' can be replaced by 'return r'. CC: Gonglei Signed-off-by: Daniel Henrique Barboza Reviewed-by: Philippe Mathieu-DaudĂ© Reviewed-by: Gonglei --- backends/cryptodev-vhost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/cryptodev-vhost.c b/backends/cryptodev-vhost.c index 8337c9a495..907ca21fa7 100644 --- a/backends/cryptodev-vhost.c +++ b/backends/cryptodev-vhost.c @@ -201,7 +201,7 @@ int cryptodev_vhost_start(VirtIODevice *dev, int total_queues) r = k->set_guest_notifiers(qbus->parent, total_queues, true); if (r < 0) { error_report("error binding guest notifier: %d", -r); - goto err; + return r; } for (i = 0; i < total_queues; i++) { @@ -236,7 +236,7 @@ err_start: if (e < 0) { error_report("vhost guest notifier cleanup failed: %d", e); } -err: + return r; } From patchwork Mon Jan 6 18:23:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218357 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="P3e1aHqs"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s48r65tJz9sPK for ; Tue, 7 Jan 2020 05:41:16 +1100 (AEDT) Received: from localhost ([::1]:57932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXJS-0005at-3P for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:41:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45867) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4W-0002cY-57 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4V-0004Yg-0M for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:48 -0500 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:34795) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4U-0004YR-Sd; Mon, 06 Jan 2020 13:25:46 -0500 Received: by mail-qt1-x843.google.com with SMTP id 5so43197290qtz.1; Mon, 06 Jan 2020 10:25:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9bVPKH/u51qFSWaRLOxFrn4Yt2i0R3QrPeQ70R4x82s=; b=P3e1aHqsVL6FmSFsstxXwCg5dTAjOFJApqJ4WypAQSeI8eX6HWV3QbH9zIRvsyFWNG GR7O39PEKugv+H6YvLY03aZDJ9/eyekRvhNqrHYR5PkkA25EsxyeuUtupT6pEcs/Jai3 Khoy44++nTdynHbbz2bI5SqZJFYxjg6DQ02jlCn2ZkTovsf2YGDVCGQsPRAYlMC1vQdI f8y/KmsDxMla0dXLZnHecVl3x8et3z8P5EmcwKKaOsaxe8cLvA00UB+A4cFax4/LmvQ8 Je8I4VSaVGNf/zPZDEKWbwbgO2EU+p8MZN86+iNA1VZjSzulahSoZXz8yJndOP5BkAnC u7Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9bVPKH/u51qFSWaRLOxFrn4Yt2i0R3QrPeQ70R4x82s=; b=S2ArbKcCyOP2R5S7+13FccnxBk0IAbI9UdXqMNCDC/BQgp+tVX6Ibmv0wztXp+XTNM hPFm8plRs+GoG7ikkuhS4m9g3o4tgmB12xtT6IMWs6n+K8K7j14MC/D+BmtwcTPrvA+5 oZ+l1QRN+9tDwLI7TkE3okXgaKgmJ+dQc3Nn8/N2mTX5L6BnJkl54rVpzfMuihB5Mfgp FkGWMgt7MwxgK22S4QWkqZgAovtLh0unRzblzFx3dOnjzTfWd8m9CgXZrt9dsJyaTMPb qEUicnHsiOpVxpT7GOFByp17dl60sDd0rHLUKutS4ZxhC7KkuEiEorY/7K9MnDbORCxK eubg== X-Gm-Message-State: APjAAAV7QQpe8tk3lh1qDu9UDGmvjkSWXivjhLAqxIvqzjueOi6QMQLa 4SfmOzJuo2J6R5K2rBHGN+eA50ca X-Google-Smtp-Source: APXvYqzUt0pJJsam0yMuf4GLbZQlWznnPX9YhdgHEcot1QfP8rnOSPzphUhEpM7hBOP2w67OZSTm9g== X-Received: by 2002:ac8:5215:: with SMTP id r21mr75440322qtn.77.1578335146381; Mon, 06 Jan 2020 10:25:46 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:45 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 30/59] util/module.c: remove unneeded label in module_load_file() Date: Mon, 6 Jan 2020 15:23:56 -0300 Message-Id: <20200106182425.20312-31-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Paolo Bonzini , Daniel Henrique Barboza Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' can be replaced by the apropriate return values set in 'ret' for each case. CC: Paolo Bonzini Signed-off-by: Daniel Henrique Barboza Reviewed-by: Thomas Huth --- util/module.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/util/module.c b/util/module.c index e9fe3e5422..9b5453f878 100644 --- a/util/module.c +++ b/util/module.c @@ -111,12 +111,10 @@ static int module_load_file(const char *fname) if (len <= suf_len || strcmp(&fname[len - suf_len], dsosuf)) { /* wrong suffix */ - ret = -EINVAL; - goto out; + return -EINVAL; } if (access(fname, F_OK)) { - ret = -ENOENT; - goto out; + return -ENOENT; } assert(QTAILQ_EMPTY(&dso_init_list)); @@ -125,8 +123,7 @@ static int module_load_file(const char *fname) if (!g_module) { fprintf(stderr, "Failed to open module: %s\n", g_module_error()); - ret = -EINVAL; - goto out; + return -EINVAL; } if (!g_module_symbol(g_module, DSO_STAMP_FUN_STR, (gpointer *)&sym)) { fprintf(stderr, "Failed to initialize module: %s\n", @@ -151,7 +148,7 @@ static int module_load_file(const char *fname) QTAILQ_REMOVE(&dso_init_list, e, node); g_free(e); } -out: + return ret; } #endif From patchwork Mon Jan 6 18:23:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218360 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="THZ+VBYY"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4CJ44TLz9sPn for ; Tue, 7 Jan 2020 05:43:24 +1100 (AEDT) Received: from localhost ([::1]:57954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXLW-0000Ao-4w for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:43:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45890) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4X-0002ff-Lu for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4W-0004aM-N1 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:49 -0500 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:34262) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4W-0004a8-JT; Mon, 06 Jan 2020 13:25:48 -0500 Received: by mail-qk1-x744.google.com with SMTP id j9so40690522qkk.1; Mon, 06 Jan 2020 10:25:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CkaRW9GkcqQi8J8yq9bVtroJ/RDDzEhUPcZDuYcLtVI=; b=THZ+VBYYtFliiVYANai24SLT6IuIr98gBcUYXtT44BxIf9LmqYCPtB+2Z7xsj1vLrp C8EdITVO5MbvcLZJqlsQFMm09UdSZL+MlnrCmfGyun1SbdBQpsiK7EC8Zid51x2kH6xP ooPpOlHPNt+vsQKIkffhiO7qORT+csTUw4eFo/MT4EsfBCqpMj9zlkotHadecCiKW1JI 6Vkac2vshedLgJP9lEU1ABl4L6nR4s2KI0KQWjtD1RNr4DBUrilbRDqAon8BeztN3kKV 7qurbXz+bygD/ok5+fnqitSdFtktz4GkPWoub89oxyX+2e34VyEAmmLpB0cldlkK0pnh knMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CkaRW9GkcqQi8J8yq9bVtroJ/RDDzEhUPcZDuYcLtVI=; b=H021zkB8N3jwijj+lQqDZ1olfm1yue9AMRKdz8BmaHeoQXsIKqeKYVBsO97YPhhVxB QjJAmkbQcjE8PZDhSf8Dc8iTxp0RAMUDXSLAPMTMWDq+QqqBVmFCK11jEzVg7OVVw/OB iTszSjpMtd45HpIK6EYgo70E3njOBPgz6dlWajhTGy2v2CPCF6rCEW+7vOv4B9gkcNrU vtygPB5uoXPxUdAlmc2We+varI54UJ5P2VQteCGo0nYbUowFw596BWeeQ2FZiTT/PW3O 9apqN2YVpHX3L9WdkoqjBzKn6teyYr15S10twKXkv3oLg25fmHVR69NG/inr2G643g6C 5rIQ== X-Gm-Message-State: APjAAAXxRHKUSxFOhA6ymUDolQkjaHDgFWUvAi2QIgeUr/t0t6abGtRF zzvR0qZDe+BgRUUoFtWyrBESgvPY X-Google-Smtp-Source: APXvYqwn+VqbjFcIZj2wWG/ZmvQIU2j6SovxRbLRfHDACElrSjqiPVjK7h8ipfumIYTJ68eww7+OXA== X-Received: by 2002:a05:620a:6b8:: with SMTP id i24mr86401008qkh.9.1578335148022; Mon, 06 Jan 2020 10:25:48 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:47 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 31/59] util/aio-posix.c: remove unneeded 'out' label in aio_epoll Date: Mon, 6 Jan 2020 15:23:57 -0300 Message-Id: <20200106182425.20312-32-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Paolo Bonzini , Daniel Henrique Barboza Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' can be replaced by 'return ret'. CC: Paolo Bonzini Signed-off-by: Daniel Henrique Barboza Reviewed-by: Thomas Huth --- util/aio-posix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util/aio-posix.c b/util/aio-posix.c index a4977f538e..7c4cfea8ce 100644 --- a/util/aio-posix.c +++ b/util/aio-posix.c @@ -121,7 +121,7 @@ static int aio_epoll(AioContext *ctx, GPollFD *pfds, ARRAY_SIZE(events), timeout); if (ret <= 0) { - goto out; + return ret; } for (i = 0; i < ret; i++) { int ev = events[i].events; @@ -132,7 +132,6 @@ static int aio_epoll(AioContext *ctx, GPollFD *pfds, (ev & EPOLLERR ? G_IO_ERR : 0); } } -out: return ret; } From patchwork Mon Jan 6 18:23:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218416 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="T4tyhqku"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4lJ1QRdz9sQp for ; Tue, 7 Jan 2020 06:07:40 +1100 (AEDT) Received: from localhost ([::1]:58418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXiz-0006QZ-Hr for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:07:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45917) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4Z-0002jN-To for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4Y-0004cN-Pr for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:51 -0500 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:42550) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4Y-0004bz-LQ; Mon, 06 Jan 2020 13:25:50 -0500 Received: by mail-qk1-x744.google.com with SMTP id z14so39015038qkg.9; Mon, 06 Jan 2020 10:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hHc8KM4wbyx7oApuYrLldPmbj5H4j8u/5LpfmbUVXc8=; b=T4tyhqkugSDw1fNHjAUkq2C8KOBU/8EGI4SIrpzht34zgrAhBGiAL0bL/pFJpErVl7 h2cXmZyXig9uRZ8Sbnb/yGrWNsLTrph9Yc5XGuKlAJD2YQBmXTF6rSc1eaOxdjKoke37 uhHunMIc06Nwk2lmSI1dCbTD8aQBIkVroN2MaFA3Hmx+10jmI8nxHgywNoHSGg0e9iEU feoY75Nn7cB6QDRKhD+S/7jKbVMb8vyX0w7r3tZT9abXigC4i2uvWfsLllzjApbg4iiU 4G/gpomo4ZCM6y87qSYolYLop1AtUd1d2lqc9uJheElCSIJv+zIySGazJYEz5BQsKMan nyZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hHc8KM4wbyx7oApuYrLldPmbj5H4j8u/5LpfmbUVXc8=; b=ZywST0Zw/9YTNhZe+EXx5ME55hbL9ln6O44LoPkhAAbDiv+Nr/nOK8PMel9ghSNlAp rPD+NZdQX08YDn+QEQcJQ36IT/brLa/Farq3qUhVLyZngdmWNMfjIVIJibwJ0r9eyKsa dZ27lS+ZMUCFZ+oOpSbNcfP1G7WxvbIOka8BmTW2YTTjZlJwpjGl4JTav1aUYK1hPElK FCpO+IZ0YH10s/SncnBm4bUenmD+YCI838flEQZ89v80/+RN6+OgeR4PBHWK4GPrJgIq 3a8D5jvLO/SBf7/Qp9QoQwD+XeerPVW2JtfwFh6o5L705AWQXIn8VxZt+oi4Cfg3N0mP qD0g== X-Gm-Message-State: APjAAAXSgMPspsGdk6z2s8Gsmk+zSmDBXzHp0YQHVa5DpTwxyWe8mUK0 cyjEImsaA+bcsLvhBQZY4iURwa7/ X-Google-Smtp-Source: APXvYqziWR5ne9olzdjMctJpqGaccIPRjn1I2s35O8ZZA3yBuUdyRiz8JOcQsiLp1p1GmlxmHKMvlw== X-Received: by 2002:a37:801:: with SMTP id 1mr86585967qki.326.1578335150132; Mon, 06 Jan 2020 10:25:50 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:49 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 32/59] qemu-img.c: remove 'out4' label in img_compare Date: Mon, 6 Jan 2020 15:23:58 -0300 Message-Id: <20200106182425.20312-33-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Kevin Wolf , Daniel Henrique Barboza , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out4' can be replaced by 'return 2'. CC: Kevin Wolf CC: Max Reitz CC: qemu-block@nongnu.org Signed-off-by: Daniel Henrique Barboza --- qemu-img.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 6233b8ca56..fc7b08e7ee 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1346,8 +1346,7 @@ static int img_compare(int argc, char **argv) opts = qemu_opts_parse_noisily(&qemu_object_opts, optarg, true); if (!opts) { - ret = 2; - goto out4; + return 2; } } break; case OPTION_IMAGE_OPTS: @@ -1371,8 +1370,7 @@ static int img_compare(int argc, char **argv) if (qemu_opts_foreach(&qemu_object_opts, user_creatable_add_opts_foreach, qemu_img_object_print_help, &error_fatal)) { - ret = 2; - goto out4; + return 2; } /* Initialize before goto out */ @@ -1559,7 +1557,6 @@ out2: blk_unref(blk1); out3: qemu_progress_end(); -out4: return ret; } From patchwork Mon Jan 6 18:23:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HVMaOLRw"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4F72kvpz9sR4 for ; Tue, 7 Jan 2020 05:44:59 +1100 (AEDT) Received: from localhost ([::1]:57976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXN2-0002PR-Vr for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:44:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45938) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4b-0002lz-Jp for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4a-0004dn-Ed for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:53 -0500 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]:42066) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4a-0004dQ-B7; Mon, 06 Jan 2020 13:25:52 -0500 Received: by mail-qk1-x729.google.com with SMTP id z14so39015125qkg.9; Mon, 06 Jan 2020 10:25:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9iBtM24gxNcAx1ejDUOR0GLhyehYr4GnSdxBSiFhd/U=; b=HVMaOLRwolx3rm3gwTHFVdu/toenkl+41BDqkp22iVBpe1ywA+YciHLQ78rv727D7z PMHWswFe8SfFERzoN/0pqtpZqfQvl5hokxyrYd8D+YPcuVWJE1c9JHSEmNZEryA+b1PU n0W30eed5E5JZ7teLKTvAmSIcPCtBPLuMsvzLG42vAyEbMyEtCrLjj26nUCf00ftheXQ NB2dUboTnsrtqBWLkTLY+5dANNFdDo2XyHnJa29lzLz0P/tOzF4PMYp0a/pUmxapllTk GCKuEeE/rbgXim+PbZmFhhBli/tYlZaxLerMH5maTXvPtq/EcssZ5yOXCvqHbVRn74o+ 88ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9iBtM24gxNcAx1ejDUOR0GLhyehYr4GnSdxBSiFhd/U=; b=AxZTRo8wcx+FzqJmc9ev/dM3IHs151/u+o6tQJZTx1hSyQ4z0db97nMc4m+0PbKQNa HP5a7TY1gYLUu1FSPLuGypOOf0JeM0osAULiJnT19XeJSWf4g+UcV1btnl0Kq8yrywBc J9Md15ZeKkmsx8yDrudHErBw9Ucq1jB8oGlb7Nah8gWFdCpPXsmr8V71hroullA600dM hELLgSxlD1EB9F2qsPglvp7lCwgGCQ99bttQSd8q7+yKhiSNLbtLESzGBL32oytxc1yL 5SafCCozMz+apcBc4a3Yef8Xz+s61iBTU7uWpGmN1x3Xumk0lFBTE+5WrB9aJpNB7JKi Pq6w== X-Gm-Message-State: APjAAAXy3awGKEQBbQshdNqZIBJHyxkpeYpOhd0RkXV+sj5sXYj4X1aM j5OR69TPx/uJNXLQV7JEHfUvCPN5 X-Google-Smtp-Source: APXvYqxNCdyCI+5IWqfjzBWWNSQlIUlqGLwOgwQRkwTxANsLrlC1DI4HIlMK5Abm1n7kSwyMxbCmyg== X-Received: by 2002:a05:620a:21d4:: with SMTP id h20mr79651642qka.468.1578335151684; Mon, 06 Jan 2020 10:25:51 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:51 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 33/59] ipmi/ipmi_bmc_sim.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:23:59 -0300 Message-Id: <20200106182425.20312-34-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::729 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Corey Minyard Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Label 'out' from ipmi_bmc_gen_event() and gen_event() can be replaced by 'return'. CC: Corey Minyard Signed-off-by: Daniel Henrique Barboza --- hw/ipmi/ipmi_bmc_sim.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c index 6670cf039d..1e06fd1de9 100644 --- a/hw/ipmi/ipmi_bmc_sim.c +++ b/hw/ipmi/ipmi_bmc_sim.c @@ -461,14 +461,12 @@ void ipmi_bmc_gen_event(IPMIBmc *b, uint8_t *evt, bool log) } if (ibs->msg_flags & IPMI_BMC_MSG_FLAG_EVT_BUF_FULL) { - goto out; + return; } memcpy(ibs->evtbuf, evt, 16); ibs->msg_flags |= IPMI_BMC_MSG_FLAG_EVT_BUF_FULL; k->set_atn(s, 1, attn_irq_enabled(ibs)); - out: - return; } static void gen_event(IPMIBmcSim *ibs, unsigned int sens_num, uint8_t deassert, uint8_t evd1, uint8_t evd2, uint8_t evd3) @@ -978,7 +976,7 @@ static void get_msg(IPMIBmcSim *ibs, if (QTAILQ_EMPTY(&ibs->rcvbufs)) { rsp_buffer_set_error(rsp, 0x80); /* Queue empty */ - goto out; + return; } rsp_buffer_push(rsp, 0); /* Channel 0 */ msg = QTAILQ_FIRST(&ibs->rcvbufs); @@ -993,9 +991,6 @@ static void get_msg(IPMIBmcSim *ibs, ibs->msg_flags &= ~IPMI_BMC_MSG_FLAG_RCV_MSG_QUEUE; k->set_atn(s, attn_set(ibs), attn_irq_enabled(ibs)); } - -out: - return; } static unsigned char From patchwork Mon Jan 6 18:24:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218361 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PcQxEVDf"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4D01lyNz9sPK for ; Tue, 7 Jan 2020 05:44:00 +1100 (AEDT) Received: from localhost ([::1]:57960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXM5-0001Bf-GD for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:43:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45958) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4c-0002o4-Sy for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4b-0004fP-T0 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:54 -0500 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:45620) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4b-0004ey-PZ; Mon, 06 Jan 2020 13:25:53 -0500 Received: by mail-qv1-xf44.google.com with SMTP id l14so19416062qvu.12; Mon, 06 Jan 2020 10:25:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+Ybn8SHkq8jjr5laYfWKQovRFgmNlWcpAqoISVHGuSA=; b=PcQxEVDfKIoEBYkWAYPs+4/6kfD+8h3oxGya2O1PCDxbqG286Exuqa4QtABEnAtgkM SeS5QttmNwC/kDzG2gAcdHnKpFoY911IygzOXoJErqeBsUM07zFhzFGVx1O7FMQOcbnP FDfE1/vf6FSBZygWQa4e7x69/YP/95CUAeTt8YHKeZvl7cVAqw90ePDPLjdSXDrZqmxN QGMsil8CfuNj4atB3UViORrwsA2vBjDL2bQJGflC7s1f4Jqspl1sRlVHQSMpOoETZck+ 1uwAsjUlNE57W55EiWzMmasyWuWYH4CDrUE+NTWVrKpWgKRzHrOx87tNfk+knkqKdMJe uMSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+Ybn8SHkq8jjr5laYfWKQovRFgmNlWcpAqoISVHGuSA=; b=H/maD4rrebleTLlOQVRe3TgxT/c5qDRPQsUGc7igG+aVtSD04U+Qj2apTllnUfi10T UpUiIKhYG5ruQhzbx0GLvDqWMHPTlf+hJFqefCuf8mXslWMmtP/2bKecZFQmOQ/XnD9O V4yt/JlgGXyct2LdDgIhZrqi/umt7U60tFFTWhdHrAGk/gYAtTM6VM91tNjaXFcHFRxp CPJdviYBJCso7NFV2iEDmoNYzjelUyStjnQH6HH26gcXs/VrhD5bAA4h0a0366RYnKaT +mKSsv0SLphPoJ/HL1DGdJriAWJsGPsTaNz2GEKxl+sXqHawS2jm85GU7O4znngETIUe ix2g== X-Gm-Message-State: APjAAAXKMdAXePSUd5PVjmgM6gHm6A2Y7AcdSgxbYrnEK2eQjRtsMP7U fl3wo61ISfSaP478SmaygLkgWkUB X-Google-Smtp-Source: APXvYqyLtTjVd0dbqEcDUlg26wRB/H7xY1Azv6a1zMD1apI7oJI2kccqTIASGHOz5KK8Bz4W0meLhQ== X-Received: by 2002:a0c:c250:: with SMTP id w16mr76989332qvh.24.1578335153245; Mon, 06 Jan 2020 10:25:53 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:52 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 34/59] ipmi/ipmi_bt.c: remove unneeded label in ipmi_bt_handle_event Date: Mon, 6 Jan 2020 15:24:00 -0300 Message-Id: <20200106182425.20312-35-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Corey Minyard Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' can be replaced by 'return'. CC: Corey Minyard Signed-off-by: Daniel Henrique Barboza --- hw/ipmi/ipmi_bt.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/ipmi/ipmi_bt.c b/hw/ipmi/ipmi_bt.c index 22f94fb98d..8173551d7d 100644 --- a/hw/ipmi/ipmi_bt.c +++ b/hw/ipmi/ipmi_bt.c @@ -98,14 +98,14 @@ static void ipmi_bt_handle_event(IPMIInterface *ii) IPMIBT *ib = iic->get_backend_data(ii); if (ib->inlen < 4) { - goto out; + return; } /* Note that overruns are handled by handle_command */ if (ib->inmsg[0] != (ib->inlen - 1)) { /* Length mismatch, just ignore. */ IPMI_BT_SET_BBUSY(ib->control_reg, 1); ib->inlen = 0; - goto out; + return; } if ((ib->inmsg[1] == (IPMI_NETFN_APP << 2)) && (ib->inmsg[3] == IPMI_CMD_GET_BT_INTF_CAP)) { @@ -136,7 +136,7 @@ static void ipmi_bt_handle_event(IPMIInterface *ii) IPMI_BT_SET_B2H_IRQ(ib->mask_reg, 1); ipmi_bt_raise_irq(ib); } - goto out; + return; } ib->waiting_seq = ib->inmsg[2]; ib->inmsg[2] = ib->inmsg[1]; @@ -145,8 +145,6 @@ static void ipmi_bt_handle_event(IPMIInterface *ii) bk->handle_command(ib->bmc, ib->inmsg + 2, ib->inlen - 2, sizeof(ib->inmsg), ib->waiting_rsp); } - out: - return; } static void ipmi_bt_handle_rsp(IPMIInterface *ii, uint8_t msg_id, From patchwork Mon Jan 6 18:24:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218417 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lFAHkREE"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4nk1wSkz9sQp for ; Tue, 7 Jan 2020 06:09:46 +1100 (AEDT) Received: from localhost ([::1]:58464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXl1-0001wg-Oh for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:09:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45993) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4e-0002rA-KL for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4d-0004h2-Ih for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:56 -0500 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:37947) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4d-0004gh-Eo; Mon, 06 Jan 2020 13:25:55 -0500 Received: by mail-qv1-xf44.google.com with SMTP id t6so19447132qvs.5; Mon, 06 Jan 2020 10:25:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8+CZdFpf3tevgOcUS4uRCI6axpXi/NG+wpiA6ZaBcfg=; b=lFAHkREEA9zOA84tmBdmJe0yyz5tibWdRaWk9V6hg2bIxqanpTLo90uhWnOiaI69TM SOXlcYKJ7rTQqloejIT2KBN6yV39/NZlV5ydKPl62oAAfzroRV9n6s+TwbRN4xmfQfrw VqF0ouw19/mmCnflhYrIeyYKutMBWOE9bT3hDcSXOb+LgyciM492n3r28O74PjyKZJaZ 75G5eUcGCw40DXFPQyrJLaKgMCzxdctqUhFNswowuqlKUdat8nOyQU4ZFW9CONVqRR9i 6SZk7eYonUgYnRlGoEfN3U91pspmgPdbOS43q3eLhUjZD0zDOxzM4iSi31YZ+Dq2T3pF ThzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8+CZdFpf3tevgOcUS4uRCI6axpXi/NG+wpiA6ZaBcfg=; b=KKiVXFctn8Cd5Xk3vRvIJuyxPryJKkZ5hOEd3JNOvJt7lyYhgnTu6oh6d6UGwxBFWI oFcyJ5VSNS2eep6yP4D6uPxY5zbCneEc6BJDktZR2y/FXr4Wo4X0ipz9tGL5YgG4zFVF vojmb8tbilrJ+w0roJ3OCH8BhvD27yloiUbQqDuFhx9YYcvr7DCz/dOBlCrQaclMwrIy 0x7krY4OunKJWZo+2ffVSYNFMedb+ElQPonENGgiAZuN8PY9f6Vc5UXuNRapELTD1tKU lcM4ygRhehRIyGydi1vE7+37DD9kokjTyIXriOAMkrxcht4kch47ucmAZRhs6SVkwp9C UBtg== X-Gm-Message-State: APjAAAXTAosNFLUcaXrM7z8ExvX2jef7ia//TFu6+A5CyhnxJJh6UUXX iHnSBb+pdjZt0EaUa9actSH18NMI X-Google-Smtp-Source: APXvYqwbOyXc8qrqk5iQUvc0gUPDpjsvnNs1tH3O5eaBsXLxEHrMGNRybDgKdBqAFkhAL8KMWl1dGA== X-Received: by 2002:a0c:8bd2:: with SMTP id a18mr53139947qvc.38.1578335154886; Mon, 06 Jan 2020 10:25:54 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:54 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 35/59] ipmi_bmc_extern.c: remove unneeded label in ipmi_bmc_extern_handle_command Date: Mon, 6 Jan 2020 15:24:01 -0300 Message-Id: <20200106182425.20312-36-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Corey Minyard Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label can be replaced by 'return'. CC: Corey Minyard Signed-off-by: Daniel Henrique Barboza --- hw/ipmi/ipmi_bmc_extern.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index 87da9ff99c..16d9114725 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -217,7 +217,7 @@ static void ipmi_bmc_extern_handle_command(IPMIBmc *b, rsp[2] = err; ibe->waiting_rsp = false; k->handle_rsp(s, msg_id, rsp, 3); - goto out; + return; } addchar(ibe, msg_id); @@ -232,9 +232,6 @@ static void ipmi_bmc_extern_handle_command(IPMIBmc *b, /* Start the transmit */ continue_send(ibe); - - out: - return; } static void handle_hw_op(IPMIBmcExtern *ibe, unsigned char hw_op) From patchwork Mon Jan 6 18:24:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218364 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pf3PzziF"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4HP6cPSz9sPK for ; Tue, 7 Jan 2020 05:46:57 +1100 (AEDT) Received: from localhost ([::1]:58014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXOx-0003yi-2l for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:46:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46022) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4g-0002um-7U for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4f-0004j2-85 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:25:58 -0500 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:40610) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4f-0004iY-4U; Mon, 06 Jan 2020 13:25:57 -0500 Received: by mail-qt1-x841.google.com with SMTP id e6so43208924qtq.7; Mon, 06 Jan 2020 10:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NDENpcOxrSQW9UZ3pijocQSdBIy4XBNwZQRjnmUpikY=; b=pf3PzziFI1qtO+PwJCFaC/uGCn0ZkFfWCqnvHr8XUQKHLuUbBUY+k0TmFTQDjaLsaD bAfAmG0r+sgHc5ZKvCFwaUwydNot+GVd+ExrvhHIADRcskMkCuX65hH6ldKGJDgw6shw C8ysLc440K7NftNq9Je3z04ZNeCMNH2AjMsxW9PsnYK7oTgoUTt/OUBqteW5MAgufL7e qzmWy9wbPyUWNQyIPVBB1xwjuMclwyIoqO55g38AdRQqdeRwg7BITwqfN2I+i8jXJ62N OrdltzzkTqef8/slUOpbaFbI3VkiIQeW0J6szpYqQnu1UX2mMlXZMstk4scORiuwCBN3 C/Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NDENpcOxrSQW9UZ3pijocQSdBIy4XBNwZQRjnmUpikY=; b=PHxHneGN7pQTIVwJFXyXf2O/Tp2UCtchSYN3siUC8Yv5WtsrysEhHA6mfbU+A3iYEo prk41ahJaS0MPvdPeK5j7pRXhSBw/gT06DPWpK8TORJhMpsHlMHdXD4/3vVeuhC73299 x5cMBWG85E0yF6d/G7npCUZ2Yz3hRoboMu1yc6lSX3JPlFKSZ75nfgCU2Qr3yMggw4IC 0uEnU84LjYhwDoBtpi1MWK3ED2JzaIZk67cTI97XLEsC+FxjKqih4KeMSCdm8ZMJ+bSr fEg5q8H7SyMYz1EB0VWmKhNqczOvQA2TuqEt2pQ7JQLCHgAR56hoZCh34Lw24HM3rwfr OQSg== X-Gm-Message-State: APjAAAU3UiZG6Ld+7MpyOn6Iej5L2CGETf9f9ckbrf2O7HLv/YIUi5c2 MGJHcJKl5nckl1vW/PsxbhKm4iCa X-Google-Smtp-Source: APXvYqwAqKKyyYmsXaeW4lCIhlIXBQ1eaRlFkQWReyJRbzWNsfs1TcHrnZG4zlrzFHLre5CY765g6w== X-Received: by 2002:ac8:490f:: with SMTP id e15mr72869796qtq.32.1578335156613; Mon, 06 Jan 2020 10:25:56 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:56 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 36/59] ipmi/ipmi_kcs.c: remove unneeded label in ipmi_kcs_handle_event Date: Mon, 6 Jan 2020 15:24:02 -0300 Message-Id: <20200106182425.20312-37-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::841 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Corey Minyard Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out_noibf' can be replaced by 'return'. CC: Corey Minyard Signed-off-by: Daniel Henrique Barboza --- hw/ipmi/ipmi_kcs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/ipmi/ipmi_kcs.c b/hw/ipmi/ipmi_kcs.c index a77612946a..83009baddb 100644 --- a/hw/ipmi/ipmi_kcs.c +++ b/hw/ipmi/ipmi_kcs.c @@ -168,7 +168,7 @@ static void ipmi_kcs_handle_event(IPMIInterface *ii) ik->outpos = 0; bk->handle_command(ik->bmc, ik->inmsg, ik->inlen, sizeof(ik->inmsg), ik->waiting_rsp); - goto out_noibf; + return; } else if (ik->cmd_reg == IPMI_KCS_WRITE_END_CMD) { ik->cmd_reg = -1; ik->write_end = 1; @@ -197,8 +197,6 @@ static void ipmi_kcs_handle_event(IPMIInterface *ii) ik->cmd_reg = -1; ik->data_in_reg = -1; IPMI_KCS_SET_IBF(ik->status_reg, 0); - out_noibf: - return; } static void ipmi_kcs_handle_rsp(IPMIInterface *ii, uint8_t msg_id, From patchwork Mon Jan 6 18:24:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218366 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oSgpl5Ca"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4L41HPVz9sPn for ; Tue, 7 Jan 2020 05:49:16 +1100 (AEDT) Received: from localhost ([::1]:58042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXRB-0006Ps-Ei for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:49:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46046) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4i-0002zH-SE for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4h-0004lK-Nk for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:00 -0500 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:41709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4h-0004l9-K3; Mon, 06 Jan 2020 13:25:59 -0500 Received: by mail-qt1-x844.google.com with SMTP id k40so43186044qtk.8; Mon, 06 Jan 2020 10:25:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dFCW/pT3CYgJTCfIMv+vOfdNZ6PcIxCGOVhdGgC1DCo=; b=oSgpl5Ca3cVgcfTotPuV6oPNOhUXbeDmGSk8zwp8nSnzWxSkS+fSYd3s7qHkr7kLuP LKNlPwfxGyQ0YIlWex+7ezogXdP22mFl9A7QOrMyVGTU/aBh/U4Vw4XW4GkBSFnmuG7o F6UKcQiHj6/uoaso0x2kYzErEBlag08WX+SEB9Kyw8B0aVWFerJwB2f9TyDy54/3OjDa bWu9CO4jiE/NBFiUwn6gYil8UwOEvdGFdqocXL3gzzzuQ7Q/o7Ri8/NcTrqnNddffeId vGROkOnHE7xn3EocOyRMiAh1yC2Ckv9gYF6uUlJtRzH9LXdAmlvn4c45ddq87HWdyIg5 GYtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dFCW/pT3CYgJTCfIMv+vOfdNZ6PcIxCGOVhdGgC1DCo=; b=Mgk41Fq3lrncJIjEBQK2T+WrGhRkx01E+l4Uo1Rx85xvGsHjThnPPOAxtNjlDf927n 1/E+W8SqInTqQfW0094OoirttabpH+pi9F2UieEJvtyH0m4O1aA6sw3+eI97xoYWhVHQ iR4ZNaJOZKLvoL+JTOahmOSzfJZsjyyAexmBd5kKlmwXE49J/6lopGUxxV/0DfqzM7CA K6SyTE0NX4a1qDu81KZKzfPdZHOdbVSLl1zbQb8bXXrUUET4182BKs8D5TkCx0hAuz2H 5Qw39e7gbHV5giJikNdWsAVK/m63sB6lttATW3WrAbJws5qFAfHhT5beBbp18SVwMrmG djcw== X-Gm-Message-State: APjAAAVGtNWjjWV+Sx4d72pj8dhUPlYLhInKJgnRGGy74ayxS9PronUs ndSlsrGKOjChu3mvDIcXlz7WdIbm X-Google-Smtp-Source: APXvYqzhcjveduVulYsE2b+5+6bnrZ4v4OsEJnrftTuEJ50lwBr9HCbWoFJXSIlnlr8iFTsXB+lZnQ== X-Received: by 2002:ac8:1194:: with SMTP id d20mr75595878qtj.243.1578335159069; Mon, 06 Jan 2020 10:25:59 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:25:58 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 37/59] s390x/event-facility.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:24:03 -0300 Message-Id: <20200106182425.20312-38-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Halil Pasic , Daniel Henrique Barboza , Christian Borntraeger , Cornelia Huck Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label from write_event_mask(), handle_sccb_read_events() and write_event_data() can be replaced by 'return'. CC: Cornelia Huck CC: Halil Pasic CC: Christian Borntraeger Signed-off-by: Daniel Henrique Barboza Reviewed-by: Thomas Huth --- hw/s390x/event-facility.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c index 6afe278cad..f3b9661f32 100644 --- a/hw/s390x/event-facility.c +++ b/hw/s390x/event-facility.c @@ -182,11 +182,11 @@ static void write_event_data(SCLPEventFacility *ef, SCCB *sccb) { if (sccb->h.function_code != SCLP_FC_NORMAL_WRITE) { sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_FUNCTION); - goto out; + return; } if (be16_to_cpu(sccb->h.length) < 8) { sccb->h.response_code = cpu_to_be16(SCLP_RC_INSUFFICIENT_SCCB_LENGTH); - goto out; + return; } /* first do a sanity check of the write events */ sccb->h.response_code = cpu_to_be16(write_event_length_check(sccb)); @@ -196,9 +196,6 @@ static void write_event_data(SCLPEventFacility *ef, SCCB *sccb) sccb->h.response_code = cpu_to_be16(handle_sccb_write_events(ef, sccb)); } - -out: - return; } static uint16_t handle_sccb_read_events(SCLPEventFacility *ef, SCCB *sccb, @@ -262,7 +259,7 @@ static void read_event_data(SCLPEventFacility *ef, SCCB *sccb) if (be16_to_cpu(sccb->h.length) != SCCB_SIZE) { sccb->h.response_code = cpu_to_be16(SCLP_RC_INSUFFICIENT_SCCB_LENGTH); - goto out; + return; } sclp_cp_receive_mask = ef->receive_mask; @@ -280,18 +277,15 @@ static void read_event_data(SCLPEventFacility *ef, SCCB *sccb) (sclp_active_selection_mask & ~sclp_cp_receive_mask)) { sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_SELECTION_MASK); - goto out; + return; } break; default: sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_FUNCTION); - goto out; + return; } sccb->h.response_code = cpu_to_be16( handle_sccb_read_events(ef, sccb, sclp_active_selection_mask)); - -out: - return; } static void write_event_mask(SCLPEventFacility *ef, SCCB *sccb) @@ -303,7 +297,7 @@ static void write_event_mask(SCLPEventFacility *ef, SCCB *sccb) if (!mask_length || (mask_length > SCLP_EVENT_MASK_LEN_MAX) || ((mask_length != 4) && !ef->allow_all_mask_sizes)) { sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_MASK_LENGTH); - goto out; + return; } /* @@ -328,9 +322,6 @@ static void write_event_mask(SCLPEventFacility *ef, SCCB *sccb) sccb->h.response_code = cpu_to_be16(SCLP_RC_NORMAL_COMPLETION); ef->mask_length = mask_length; - -out: - return; } /* qemu object creation and initialization functions */ From patchwork Mon Jan 6 18:24:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218368 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mSCzFxGk"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4MV1sgQz9sPK for ; Tue, 7 Jan 2020 05:50:30 +1100 (AEDT) Received: from localhost ([::1]:58058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXSN-0007wP-J6 for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:50:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46073) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4k-00032Y-Oy for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4j-0004nK-Nq for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:02 -0500 Received: from mail-qv1-xf43.google.com ([2607:f8b0:4864:20::f43]:41661) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4j-0004ms-Jp; Mon, 06 Jan 2020 13:26:01 -0500 Received: by mail-qv1-xf43.google.com with SMTP id x1so19420805qvr.8; Mon, 06 Jan 2020 10:26:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AeTlk6Mv4Sdw9TGJE5bJAMzPZ3CIV82gaf3D39HkxpY=; b=mSCzFxGkDvJH0IMXM8h4ve+2MYWjYSUJ4vRU40x8Ls6nAraZaxAfEODkR5bkOFVIky i2+oZq3zbx0+xFWnHOovK57omXi1H9FEOvBGxcw8rd3OcFn3bA32YjdviqLJ4v9Bgmyl dp8nN/Tw8//TvPwC6hY8LRh0Agag5ip8u3PG2TVYhHDVLHTmR+a0jFEYsvQXnQZBtvTr dm1nES3c0C1Cc0ccjxtbW2ir23ihHJQZYBys26BR0Pp44yuc7/11mIyFtGSrNba3uXvs xss3gMUzvuCYHgEbqpjVoLxv98zEt4z+0ipt7gs/el1J1zLTe3U6LoMIMzkgdMSeUlwh 1QzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AeTlk6Mv4Sdw9TGJE5bJAMzPZ3CIV82gaf3D39HkxpY=; b=r6Xj9zn7atMoWwNG35F9wMUiE9IfW/LLRASuZC/gErFmTlX++o+YbaNvGlj0Daw8nf BtBI5LHAxHK1U1EaNUwOiiaMr7kkmGQkHFBi4KdGNf3/MXW2zTzTDfY9SY0+IFDBk77B 1tOBT/J23XEn4RfpxKaHZaVl3WeIAN7WEuy0X4kn/PqcYhYImSzETZwbNCWIVncdBj7K 7tmxMeVpSUu3PRHo3wpiEJ+wk4MILeF9Y2mHVKDL10QD6D3M6dqmZcnt+DSFlEaFyay9 6vJtlaORC/3dk6AmiTRs3PgoNjHtPpcNDRCjqtBnFg/4oVIgOh7K2D/3hyC88ySGPJ9J E2Sg== X-Gm-Message-State: APjAAAVTRygo0VaZm8foCxb0pCh+rVr8OrBrbo6BMayWgzmd8EJy3Orc vX5r/TUfYSkQ9qGj/Uf5vRhU1god X-Google-Smtp-Source: APXvYqydM2v6y698cHrh6e48dCGfdy3XG0GFCyDtLkp+J84lN4ZngHlwI7Wr28Og/NNJ84T9Q4lJEA== X-Received: by 2002:a05:6214:1150:: with SMTP id b16mr81204786qvt.71.1578335161010; Mon, 06 Jan 2020 10:26:01 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.25.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:00 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 38/59] s390x/sclp.c: remove unneeded label in sclp_service_call() Date: Mon, 6 Jan 2020 15:24:04 -0300 Message-Id: <20200106182425.20312-39-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f43 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Halil Pasic , Daniel Henrique Barboza , Christian Borntraeger , Cornelia Huck Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label can be replaced by 'return' with the appropriate value. The 'r' integer, which is used solely to set the return value for this label, can also be removed. CC: Cornelia Huck CC: Halil Pasic CC: Christian Borntraeger Signed-off-by: Daniel Henrique Barboza Reviewed-by: Thomas Huth --- hw/s390x/sclp.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index f57ce7b739..af0bfbc2ec 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -197,24 +197,20 @@ int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code) { SCLPDevice *sclp = get_sclp_device(); SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp); - int r = 0; SCCB work_sccb; hwaddr sccb_len = sizeof(SCCB); /* first some basic checks on program checks */ if (env->psw.mask & PSW_MASK_PSTATE) { - r = -PGM_PRIVILEGED; - goto out; + return -PGM_PRIVILEGED; } if (cpu_physical_memory_is_io(sccb)) { - r = -PGM_ADDRESSING; - goto out; + return -PGM_ADDRESSING; } if ((sccb & ~0x1fffUL) == 0 || (sccb & ~0x1fffUL) == env->psa || (sccb & ~0x7ffffff8UL) != 0) { - r = -PGM_SPECIFICATION; - goto out; + return -PGM_SPECIFICATION; } /* @@ -226,8 +222,7 @@ int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code) /* Valid sccb sizes */ if (be16_to_cpu(work_sccb.h.length) < sizeof(SCCBHeader)) { - r = -PGM_SPECIFICATION; - goto out; + return -PGM_SPECIFICATION; } switch (code & SCLP_CMD_CODE_MASK) { @@ -257,8 +252,7 @@ out_write: sclp_c->service_interrupt(sclp, sccb); -out: - return r; + return 0; } static void service_interrupt(SCLPDevice *sclp, uint32_t sccb) From patchwork Mon Jan 6 18:24:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hquBNycW"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4PT1LnDz9sPK for ; Tue, 7 Jan 2020 05:52:13 +1100 (AEDT) Received: from localhost ([::1]:58090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXU2-0001y1-I9 for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:52:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46104) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4m-00035D-FR for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4l-0004ov-EP for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:04 -0500 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:42728) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4l-0004ob-Az; Mon, 06 Jan 2020 13:26:03 -0500 Received: by mail-qt1-x843.google.com with SMTP id j5so43174722qtq.9; Mon, 06 Jan 2020 10:26:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=301DkkDUxv3dPn9xvTGgX6Pv43C1RPkzmMlQLGd0qHc=; b=hquBNycWNl+ENHsKsMjfCmPFF1DOp8XloeCrj3iHYhmGbriBB7dQUpG+X6sgjAUFPx X3yaM30aHtL7QxT050qO1F0HH1wkUPDRJbxjprBkCjXnIWDZcCtQKVROwfG2wwBv/ytY 5cvTkWDCfXjmQHKTcLvNOjoHgRtP21guRyxVjXloVSiFJ8zsvmVlKXH35OJIh9w2pkQD NU3EJ39+K3onHFB+O59L29NTetZPuTO0ljPqjTYz/v2RjoOg33Ul0r9QOk/yYR6ggm0l 7rpMTM0r0XyuIzV6G1LU1eEVU0whQvUH7PaKIr6G6vcs/nndvu9vm6iqhp0/Ljq+gTt8 PuuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=301DkkDUxv3dPn9xvTGgX6Pv43C1RPkzmMlQLGd0qHc=; b=bjJk9zh/obI+jWoBSb9QyrV/czTVSj3MplIQXBpoesCme4cYoNCJq/h3OFmhLsgPPX XgCsNwXmt9wsyY1jVtPDycDw/6zrDNkuvgVpYXeNUJ5O3EllidQkTLKI4CEE8CsqOW+i 7Qb8wF+LvO5ttggQi4MQUHOy3ces1wIBy53ftltE/kk7ksp11ppZQYegrGp4wwMV9kie Kx2qqiCf2SrgwRfFiZDcc/ShiaSbeFsnFpyyT6n2HXUYODj3gSvQvZJ5ok97lM5Jid15 jhg7t8DWSVi8InT5RzGwtZR9GzU5hD8+Pjg+0pfkKFZ3xFeNJchoNIIM47v5Jkn2a4gA 6jHQ== X-Gm-Message-State: APjAAAVEyTWsakmwAQexDfyYeFnfhy7NmxfwmvZoe3cnnUW1YyCFAISd S3EdHIXFxf8fT6YOmSDlWeNSeWDF X-Google-Smtp-Source: APXvYqyRUk8GcrdqDkPnDntduyUj6VAGXrcqJmNj0X4PDHykubAkSDc5os1yABVEG6x3845DnHIBuw== X-Received: by 2002:ac8:6f73:: with SMTP id u19mr74465496qtv.102.1578335162748; Mon, 06 Jan 2020 10:26:02 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:02 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 39/59] usb/dev-mtp.c: remove unneeded label in write_retry() Date: Mon, 6 Jan 2020 15:24:05 -0300 Message-Id: <20200106182425.20312-40-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'done' can be replaced by 'return 0'. The 'ret' variable can be removed since it's only set in qemu_write_full(), which is now the returned value of the function. write_retry() body also has an extra layer of identation. Let's fix that to make it compliant with the other functions in the file. CC: Gerd Hoffmann Signed-off-by: Daniel Henrique Barboza --- hw/usb/dev-mtp.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 7c07295519..818aa066c9 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -1576,16 +1576,11 @@ static char *utf16_to_str(uint8_t len, uint8_t *str16) /* Wrapper around write, returns 0 on failure */ static uint64_t write_retry(int fd, void *buf, uint64_t size, off_t offset) { - uint64_t ret = 0; - - if (lseek(fd, offset, SEEK_SET) < 0) { - goto done; - } - - ret = qemu_write_full(fd, buf, size); + if (lseek(fd, offset, SEEK_SET) < 0) { + return 0; + } -done: - return ret; + return qemu_write_full(fd, buf, size); } static int usb_mtp_update_object(MTPObject *parent, char *name) From patchwork Mon Jan 6 18:24:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218375 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PpUVHzsy"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4Sg5kQwz9sPn for ; Tue, 7 Jan 2020 05:54:59 +1100 (AEDT) Received: from localhost ([::1]:58120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXWj-0005rF-6j for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:54:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46148) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4o-00039p-NI for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4n-0004qu-6L for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:06 -0500 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]:41709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4n-0004qX-2V; Mon, 06 Jan 2020 13:26:05 -0500 Received: by mail-qt1-x842.google.com with SMTP id k40so43186289qtk.8; Mon, 06 Jan 2020 10:26:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jkWrhgPSptvUdoRpBvu+nZPt4DG/CCW6P9e4SvO3R4Y=; b=PpUVHzsymhP0qmvWWvSH988bOE8R/TWD2utS/aX3eog494DPlrx06/rLaIj/20bdOD 5cw7BvX+je2pcnvWwYaAt0BlnD8JeZEhq4YaZ2fjSBW0E+Aq/GrFCHEcEDTNyLogntj1 4LgtKWaFgsSfXKgXLvi5hnn4YuWWrd89zF2VI8qK0yFs3EKSllP9i35mywAVXz4knxtK /ZoIxnj2xzEYMgDe8c5ThzuPJd+M4atCl3zbtmXUaA0o0mDwkqGPo3Zxet287hcMM0m9 cL8S0bQwL4eYsHUxhEDrEH3nEp23MUUNQzwb9N+Div5n48JnD3bFUbKI25aWssVDp7/3 fhOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jkWrhgPSptvUdoRpBvu+nZPt4DG/CCW6P9e4SvO3R4Y=; b=uKzQZEN4LUMYBF2rPtnWCNxrIqPduI4FaE2HSd3EGPiS/Y8my5Cpjvy9o/S4VS0YS3 idh/NHfHFjHHP08DWLXC+xv7m6vmuRgtYf6FN0HTcHVlCZt7BSbn+By8S95BzOOjJXZK BUNmhbglhaBFe090MoCY7HD4I7NMBmME+mYI80jtUfbXK/q7Z9S2BTYc6y3m+TZCOYbV zj0yG0tW3FebmarxqT5Ayzj0N5643wMFurkAb6D7A/UubE4aBGmzftdcPB0gHejsjjK6 vtSVLcuWVTZOPmPV5H11TcaF+AhLOqjVOqTtEw9XY2kkOnrqvN9aTzyHV8E2U1y6p6br JR7A== X-Gm-Message-State: APjAAAWR+HatDfD6WYQuILLeeLlmM2u7shvghX4IQ1bm9PIerm5SYl20 DJEJXYMfu//IXlBkh1e1RPGM9uVe X-Google-Smtp-Source: APXvYqyfAVd/QYltAIZUHmuLgfKU7232NaaldQUa3oK+LsgJIaAp0wBAPCDwRaSixBJh8RVGfnZ/Eg== X-Received: by 2002:ac8:404e:: with SMTP id j14mr67129587qtl.312.1578335164489; Mon, 06 Jan 2020 10:26:04 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:04 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 40/59] hsb/hcd-ehci.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:24:06 -0300 Message-Id: <20200106182425.20312-41-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::842 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Label 'out' in ehci_state_fetchentry(), ehci_state_waitlisthead(), ehci_state_fetchqh() and ehci_state_execute() can be replaced by 'return' with the appropriate value. CC: Gerd Hoffmann Signed-off-by: Daniel Henrique Barboza --- hw/usb/hcd-ehci.c | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 56ab2f457f..d8103102d6 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -1511,7 +1511,6 @@ static int ehci_state_waitlisthead(EHCIState *ehci, int async) { EHCIqh qh; int i = 0; - int again = 0; uint32_t entry = ehci->asynclistaddr; /* set reclamation flag at start event (4.8.6) */ @@ -1536,8 +1535,7 @@ static int ehci_state_waitlisthead(EHCIState *ehci, int async) ehci_set_fetch_addr(ehci, async, entry); ehci_set_state(ehci, async, EST_FETCHENTRY); - again = 1; - goto out; + return 1; } entry = qh.next; @@ -1550,8 +1548,7 @@ static int ehci_state_waitlisthead(EHCIState *ehci, int async) ehci_set_state(ehci, async, EST_ACTIVE); -out: - return again; + return 0; } @@ -1565,7 +1562,7 @@ static int ehci_state_fetchentry(EHCIState *ehci, int async) if (NLPTR_TBIT(entry)) { ehci_set_state(ehci, async, EST_ACTIVE); - goto out; + return 0; } /* section 4.8, only QH in async schedule */ @@ -1597,7 +1594,6 @@ static int ehci_state_fetchentry(EHCIState *ehci, int async) return -1; } -out: return again; } @@ -1617,14 +1613,12 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async) if (q->seen > 1) { /* we are going in circles -- stop processing */ ehci_set_state(ehci, async, EST_ACTIVE); - q = NULL; - goto out; + return NULL; } if (get_dwords(ehci, NLPTR_GET(q->qhaddr), (uint32_t *) &qh, sizeof(EHCIqh) >> 2) < 0) { - q = NULL; - goto out; + return NULL; } ehci_trace_qh(q, NLPTR_GET(q->qhaddr), &qh); @@ -1658,8 +1652,7 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async) DPRINTF("FETCHQH: QH 0x%08x. H-bit set, reclamation status reset" " - done processing\n", q->qhaddr); ehci_set_state(ehci, async, EST_ACTIVE); - q = NULL; - goto out; + return NULL; } } @@ -1688,7 +1681,6 @@ static EHCIQueue *ehci_state_fetchqh(EHCIState *ehci, int async) ehci_set_state(ehci, async, EST_ADVANCEQUEUE); } -out: return q; } @@ -1932,8 +1924,7 @@ static int ehci_state_execute(EHCIQueue *q) /* 4.10.3, bottom of page 82, go horizontal on transaction counter == 0 */ if (!q->async && q->transact_ctr == 0) { ehci_set_state(q->ehci, q->async, EST_HORIZONTALQH); - again = 1; - goto out; + return 1; } if (q->async) { @@ -1942,7 +1933,7 @@ static int ehci_state_execute(EHCIQueue *q) again = ehci_execute(p, "process"); if (again == -1) { - goto out; + return -1; } if (p->packet.status == USB_RET_ASYNC) { ehci_flush_qh(q); @@ -1954,14 +1945,11 @@ static int ehci_state_execute(EHCIQueue *q) } else { again = 1; } - goto out; + return again; } ehci_set_state(q->ehci, q->async, EST_EXECUTING); - again = 1; - -out: - return again; + return 1; } static int ehci_state_executing(EHCIQueue *q) From patchwork Mon Jan 6 18:24:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218372 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fRNkR8Pq"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4Qh2ywzz9sPK for ; Tue, 7 Jan 2020 05:53:16 +1100 (AEDT) Received: from localhost ([::1]:58102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXV3-0003iJ-Tg for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:53:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46163) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4p-0003BE-Fc for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4o-0004tw-Hy for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:07 -0500 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]:37690) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4o-0004tX-EI; Mon, 06 Jan 2020 13:26:06 -0500 Received: by mail-qt1-x844.google.com with SMTP id w47so43209353qtk.4; Mon, 06 Jan 2020 10:26:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9CWmGBj5aHcDceZZnak42d3HhmzkoQ6hZFURnh41AJQ=; b=fRNkR8Pq92PLD4Rj2lj2DlkW57FOCci79QyrBY/E4ItMBC7xeq+R4kunKB7FeSjPBu zE7qF4hW36T00wvtYM1tPvWSSPc3sGscMOX2LcqviMfYfAb956a3JsAgBzi+Z03E7w+d o2Jmt6n7jy0juIFX8uBKPJsDlAmbis15KOmxjz457UtyLCyjMojluXkmvYoNTesQtRas I7Wvx2kAjPaAr8vps60mOcT+IOz3SpGyaxZMaN7Zqfu4ELJ6S5cCMZOdTJ1tAU9KUowr hUuGn9M6ibX620kKFO66ixGhvZpTc5ESQMjCQ75CZdfxcqZZIMJx74PaVpZRu1UFkFCQ EcQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9CWmGBj5aHcDceZZnak42d3HhmzkoQ6hZFURnh41AJQ=; b=EzlkzNHDcQmVHgLKfsP1dPDKfz0gGvIB88Uj+Y16rR5Z55QNKbrOcIlPoWVWwy3y7+ H5vTd9aooqOZ2mDkceDfJS8GglNNE/53DZqQvLye+ZodkUO9PiZzCXTx8esGVB4D6Wvq gLwbgDReBPFQmdYWFnGBfS6zvw9McVCxD3Jt3DjdbpprbdhUdwsqTVCPpxlJg3cvEpC9 CJV4kTYZBkWorbmfeL6Sf0+7eqjkVeD5pm78zWa35T+MefdBpqOo82tbceTM+qfnrOBk gSjj7k4a69opRufaZVM64HviakgdEDb6FIT2ifq6Xka19lQyKtdR/cGzPFIV0dqK0oDQ csIw== X-Gm-Message-State: APjAAAW3xAIX5RfBDC2GIl1ivBnEB7K++t/5J6I/aSbaEqAib6RK8t78 P6J3mCtMAqx8uORp2S0QOSieOXT4 X-Google-Smtp-Source: APXvYqzTlr5xjO3oGTrwz33FSc5NOPPkNEHipnTdpGDDmkxvyLdJGLhxx5lH/htTz8fDtvcjIVnPbg== X-Received: by 2002:ac8:5457:: with SMTP id d23mr72710032qtq.93.1578335165941; Mon, 06 Jan 2020 10:26:05 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:05 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 41/59] intc/s390_flic_kvm.c: remove unneeded label in kvm_flic_load() Date: Mon, 6 Jan 2020 15:24:07 -0300 Message-Id: <20200106182425.20312-42-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::844 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label can be replaced by 'return' with the apropriate value that is set by 'r' right before the jump. Christian Borntraeger Signed-off-by: Daniel Henrique Barboza Reviewed-by: Thomas Huth --- hw/intc/s390_flic_kvm.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index dddd33ea61..2e1e70c61d 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -439,17 +439,14 @@ static int kvm_flic_load(QEMUFile *f, void *opaque, size_t size, count = qemu_get_be64(f); len = count * sizeof(struct kvm_s390_irq); if (count == FLIC_FAILED) { - r = -EINVAL; - goto out; + return -EINVAL; } if (count == 0) { - r = 0; - goto out; + return 0; } buf = g_try_malloc0(len); if (!buf) { - r = -ENOMEM; - goto out; + return -ENOMEM; } if (qemu_get_buffer(f, (uint8_t *) buf, len) != len) { @@ -460,7 +457,6 @@ static int kvm_flic_load(QEMUFile *f, void *opaque, size_t size, out_free: g_free(buf); -out: return r; } From patchwork Mon Jan 6 18:24:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218383 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PdJHk+dx"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4Tz5MRyz9sPK for ; Tue, 7 Jan 2020 05:56:07 +1100 (AEDT) Received: from localhost ([::1]:58144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXXp-0007YZ-7M for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:56:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46195) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4r-0003Fv-Qk for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4q-0004vr-P9 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:09 -0500 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:44706) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4q-0004va-Lf; Mon, 06 Jan 2020 13:26:08 -0500 Received: by mail-qv1-xf41.google.com with SMTP id n8so19407992qvg.11; Mon, 06 Jan 2020 10:26:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e2Pglg9q4RMFoXAtcnS8nyYGqCU2Tjq8RVW10uPUEeA=; b=PdJHk+dxqZORm7y8xJbfbi8AyLgfnD4aDeCYFLOeiHbk6FSIg1xKIWSA6cXNY2hrcT p1U98c0XD4iJxVvzonsagevv8f2o4xNMwnVPWe1i+03yeEFgBv5HWFdS1YqVp9St2RaR iEESSUn0ONAvWl/TL0V3FYkWi6Dg7kjF2t1tBkNurApYktaikl25//wppIT+8pwYK6C9 RVE13ERlyHzzXRXNEUZMJQg3xKXc/BpqkahYfH2JR+7w+vC3CJph6mfR5yD75hAkgur6 1eKHrlaqN2RL3BNKODPy7BGY46eh5kIfbhOZdKg7qKmstSi7EoGstEYzhG+KZJfn2lLb bFVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e2Pglg9q4RMFoXAtcnS8nyYGqCU2Tjq8RVW10uPUEeA=; b=qYMfM6k5coz0ShGTqTI/t93vW/QDZ32dypFP/1gNqlQmivEEHxUVksu8UoGUGPlgXI GSZ01ivnaR97z2CgvHBLYlsvYEkharltGgwkpWXevTNy8tMA82h+9L1vXI+clwpOvEng M2/EHitUTBBYam+4K+AraHHo7K1QwIEw+YBEYYlTKSmdK1GqkrXUs7QARuu8KkKBRknx Aus4Eej9r3yUgfxF29ULDV3nGxTPfaLRwik+t8IWdbg3ZBoFfPmbw0XigUvvmkR4I7A9 7IW/3LBrUeaT3mZQVFHGmwPVHFM+PYDTxhjIumeqgsIPtelZoUe0+8vo5TklrKugEFM/ kw6Q== X-Gm-Message-State: APjAAAXDRSZwgRh9vGk0X5YPZjHEj2lktGJSeXlvzY3HYb+WZEMaoiur reX5H0keb4/82jOoIGikzEisWpT7 X-Google-Smtp-Source: APXvYqyMOUdvQFsVG1KX82JecU22kDLwhxzjSAPzowB71iFledUIlr4Xia7OhmMcc+66CTt7CwzG+A== X-Received: by 2002:a05:6214:923:: with SMTP id dk3mr77520156qvb.96.1578335168111; Mon, 06 Jan 2020 10:26:08 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:07 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 42/59] i386/intel_iommu.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:24:08 -0300 Message-Id: <20200106182425.20312-43-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f41 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label in vtd_lookup_iotlb() and 'done' label in vtd_process_device_iotlb_desc() can be replaced by 'return' with the apropriate value. CC: Michael S. Tsirkin CC: Marcel Apfelbaum Signed-off-by: Daniel Henrique Barboza --- hw/i386/intel_iommu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 43c94b993b..e0dd987851 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -304,11 +304,10 @@ static VTDIOTLBEntry *vtd_lookup_iotlb(IntelIOMMUState *s, uint16_t source_id, source_id, level); entry = g_hash_table_lookup(s->iotlb, &key); if (entry) { - goto out; + return entry; } } -out: return entry; } @@ -2380,12 +2379,12 @@ static bool vtd_process_device_iotlb_desc(IntelIOMMUState *s, vtd_bus = vtd_find_as_from_bus_num(s, bus_num); if (!vtd_bus) { - goto done; + return true; } vtd_dev_as = vtd_bus->dev_as[devfn]; if (!vtd_dev_as) { - goto done; + return true; } /* According to ATS spec table 2.4: @@ -2410,7 +2409,6 @@ static bool vtd_process_device_iotlb_desc(IntelIOMMUState *s, entry.translated_addr = 0; memory_region_notify_iommu(&vtd_dev_as->iommu, 0, entry); -done: return true; } From patchwork Mon Jan 6 18:24:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218418 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GtSaFG8D"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4rQ5l8Xz9sQp for ; Tue, 7 Jan 2020 06:12:06 +1100 (AEDT) Received: from localhost ([::1]:58556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXnI-0005Py-4l for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:12:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46223) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4t-0003Jc-MS for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4s-0004yM-MB for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:11 -0500 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:38123) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4s-0004y0-I5; Mon, 06 Jan 2020 13:26:10 -0500 Received: by mail-qk1-x741.google.com with SMTP id k6so40298558qki.5; Mon, 06 Jan 2020 10:26:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3FG9qdDQWzZLGEvFHKtE2+cU1rKneLyoMCDilVuOhQw=; b=GtSaFG8D1mBVeP9wYwdRsmx7jcl3MN12LcQELS2dx6mPJSyN+d7D/TqBkLUCcUL91Z pshF27WZbKMYFQAIp0G4naYN6nBcbDAUwS3tGLKw+LiUdVLz/pk3TKGQMBQDx2FZHddP d0T4Twaa5/Hj9ChzEhzh3XDZd5t2VROGdeqMd+XXWfewSFZvAeKIwGw5ZO9sEHVBHcOR sGwzTMjVSmPuzGHTsv/n+t5sYkUbgcYQs8QKVKJbo1j/13rd6hIdiDI0zOrYsOa9MyXW cPlXfBfLUnBZDh/CPdxw/iGylpD0cCctLe4kxmE0IDmXsHHDx+0DvOhTrVMxUZTTZkSb xIWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3FG9qdDQWzZLGEvFHKtE2+cU1rKneLyoMCDilVuOhQw=; b=XG+9UbDaGOr/+d3ZBow58jUjBNpFwGQBfFqBXam3JwNWMAC/u9zXX2G4FORF+P3i1j IhjHWBpaF82HJlQ+8sduPp2jf9ttLmaavRS2EPTDxwCxpEEyrHpU/ElajCSEXv8wEMSY ZYEQJ0dkGKr3TQ1QDnRLkNHy2/8Xg98i8QqLOAaWWB8D1xslTjSzOMQv1XtqVK7xWCnu rADTwYtCEQJwEtbwUaYlnQDGMPuqDnhQqW7Hz+bRnF8SO93Oa/BfwOxgMOpGYoLvb3nj IQYI4/2SctCTRRF4nWe52e1L1FEqJnC7G2hX4aKWt+/Z7uK2HZ+ttCip+O+AgUReSAp/ sKdQ== X-Gm-Message-State: APjAAAUGbv3EN1CiGYNTJaSOeCCAGZJN7Uu/qXl8gtVMEfEqZh7+Jzkc NHH7eSus5dc8OygoRKeGwyLSR3xm X-Google-Smtp-Source: APXvYqzFew3AJMCvTiarhXTnm1iHIqDjLoyAdP9XUwvEvi4CAIw5zq9xyF6Xr0nVkXGwaZxqVdwk1g== X-Received: by 2002:a37:48f:: with SMTP id 137mr83918265qke.25.1578335169968; Mon, 06 Jan 2020 10:26:09 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:09 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 43/59] i386/amd_iommu.c: remove unneeded label in amdvi_int_remap_msi() Date: Mon, 6 Jan 2020 15:24:09 -0300 Message-Id: <20200106182425.20312-44-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'remap_fail' label can be replaced by 'return' with the adequate error value. CC: Michael S. Tsirkin CC: Marcel Apfelbaum Signed-off-by: Daniel Henrique Barboza --- hw/i386/amd_iommu.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index b1175e52c7..711e1f6e40 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1268,7 +1268,7 @@ static int amdvi_int_remap_msi(AMDVIState *iommu, trace_amdvi_ir_delivery_mode("fixed/arbitrated"); ret = __amdvi_int_remap_msi(iommu, origin, translated, dte, &irq, sid); if (ret < 0) { - goto remap_fail; + return ret; } else { /* Translate IRQ to MSI messages */ x86_iommu_irq_to_msi_message(&irq, translated); @@ -1298,7 +1298,7 @@ static int amdvi_int_remap_msi(AMDVIState *iommu, } if (ret < 0) { - goto remap_fail; + return ret; } /* @@ -1309,25 +1309,20 @@ static int amdvi_int_remap_msi(AMDVIState *iommu, dest_mode = (origin->address >> MSI_ADDR_DEST_MODE_SHIFT) & 1; if (dest_mode) { trace_amdvi_ir_err("invalid dest_mode"); - ret = -AMDVI_IR_ERR; - goto remap_fail; + return -AMDVI_IR_ERR; } if (pass) { memcpy(translated, origin, sizeof(*origin)); } else { trace_amdvi_ir_err("passthrough is not enabled"); - ret = -AMDVI_IR_ERR; - goto remap_fail; + return -AMDVI_IR_ERR; } out: trace_amdvi_ir_remap_msi(origin->address, origin->data, translated->address, translated->data); return 0; - -remap_fail: - return ret; } static int amdvi_int_remap(X86IOMMUState *iommu, From patchwork Mon Jan 6 18:24:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218422 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SQQZXd0H"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4tf5B6yz9sQp for ; Tue, 7 Jan 2020 06:14:01 +1100 (AEDT) Received: from localhost ([::1]:58588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXp7-0000Da-Tk for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:13:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46251) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4v-0003MZ-Jy for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4u-000508-Bz for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:13 -0500 Received: from mail-qv1-xf44.google.com ([2607:f8b0:4864:20::f44]:44709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4u-0004zT-8L; Mon, 06 Jan 2020 13:26:12 -0500 Received: by mail-qv1-xf44.google.com with SMTP id n8so19408060qvg.11; Mon, 06 Jan 2020 10:26:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mpfIHJqJRcqC4Yq+ELUmZkb3CWZtgP1HlVj632oKpm4=; b=SQQZXd0Hkm27bw09ihFgZpDdMnFMt5UqLm7MMQo1Baw8csh13X325ESiZ2a1n8di4I cyg1Ew9ipVOzN8liH9UcttZCbJLe/gOj2CM40aXfsn8Sbo3RHMztenxxNu6gS4pnHQW2 fWwuDVvHANdc1mvbwIi77g+qf0bq9yOpjg1ibzdqD5vqS1tWIjiGF+HkxCnoBEd00G4S 35z8jlkaqxPX7FaBTq5cGBn2qP5Wylc58mLQtvWfuDSFe6TAORRbyHpo8oFZTowueK79 zod7gGyH4aCn3f+f7Ni46cHhb5oe26WybhsHJnQ3MrLmDno1hagR+BiWfNIZKsaNhib9 G/6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mpfIHJqJRcqC4Yq+ELUmZkb3CWZtgP1HlVj632oKpm4=; b=eZbYU4SBhVA6NP7OJgYB+h3uefhkwV09yiyaCDyF54/OGha9rpzLSRYl8n3gcaqBvQ dPz4T9fgjhZSrXTnU5/y4VdgLNVowK0imO95qYaZKul4itMUc8+BkkEfrHKiyfu8jC27 B+mBC34qp8kyEpgbEfy67pdBTTaymaR87uc5uVKdazZiTaVogoUuadPSI1AOATfcP+Oa jd+GQ/2ZITImLNvIDl29X2sXQYB/9DQoPe0YNtJ6yg3IzW8A7D+u/9jfzfl06l+cOSyG 1KHPT9K7fPafpQgGlamAL/IJeXipmWkA3YDBW1Uupl5zYN8eTicNE645dKK8lWGksBnV Ofgg== X-Gm-Message-State: APjAAAUc6XOednrUgJjv5ECToPUsTYxYBOXBkQneKpRAGXX8xZvcjrz6 bhZMGFsQUM4PAUiRBJURlkMoKtH7 X-Google-Smtp-Source: APXvYqxmtVPcSIQ61YfaX5ax6qApQhozK+8b0/vmjFHP/QdsenqVJrYHT3fEy/D5ZOY2OaML8pv2SA== X-Received: by 2002:a05:6214:118d:: with SMTP id t13mr78133928qvv.5.1578335171686; Mon, 06 Jan 2020 10:26:11 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:11 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 44/59] 9p-local.c: remove unneeded label in local_unlinkat_common() Date: Mon, 6 Jan 2020 15:24:10 -0300 Message-Id: <20200106182425.20312-45-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f44 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'err_out' can be replaced by 'return ret' in the error conditions the jump was being made. CC: Greg Kurz Signed-off-by: Daniel Henrique Barboza --- hw/9pfs/9p-local.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index ca641390fb..f9bdd2ad7c 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1094,12 +1094,12 @@ static int local_unlinkat_common(FsContext *ctx, int dirfd, const char *name, fd = openat_dir(dirfd, name); if (fd == -1) { - goto err_out; + return ret; } ret = unlinkat(fd, VIRTFS_META_DIR, AT_REMOVEDIR); close_preserve_errno(fd); if (ret < 0 && errno != ENOENT) { - goto err_out; + return ret; } } map_dirfd = openat_dir(dirfd, VIRTFS_META_DIR); @@ -1107,16 +1107,14 @@ static int local_unlinkat_common(FsContext *ctx, int dirfd, const char *name, ret = unlinkat(map_dirfd, name, 0); close_preserve_errno(map_dirfd); if (ret < 0 && errno != ENOENT) { - goto err_out; + return ret; } } else if (errno != ENOENT) { - goto err_out; + return ret; } } - ret = unlinkat(dirfd, name, flags); -err_out: - return ret; + return unlinkat(dirfd, name, flags); } static int local_remove(FsContext *ctx, const char *path) From patchwork Mon Jan 6 18:24:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218388 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="E0AwercU"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4Wd654Rz9sPK for ; Tue, 7 Jan 2020 05:57:33 +1100 (AEDT) Received: from localhost ([::1]:58170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXZD-0001Ke-9e for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:57:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46272) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4w-0003OX-Uo for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4v-00051U-Q0 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:14 -0500 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:41165) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4v-000515-M6; Mon, 06 Jan 2020 13:26:13 -0500 Received: by mail-qk1-x742.google.com with SMTP id x129so40279331qke.8; Mon, 06 Jan 2020 10:26:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8LtGJFRoLm+1QViJT/TSBBPXd3MZMx440gcj2kcTdA4=; b=E0AwercUzSfgtOPsdaKwCargU5p1STDCJT25acr9PLcWwNzJVhZNBfbIIoAOJElWNh pRx3+aoOoI+GvsMLVeyfpdl3RUmg+qa9GgpwKCsg43/7KB6s6UY/CggIQ7wUhkPqXlwt BdNAry1dcFq5VH4T3oSmu1XC6++yaN5dZFLiaTkw5OSyR5qPzuL58r5MyERrG4yax8Lh F7fvShSFdDgJwsXlpuiVGLwQsS0y8pj9MjZb58sFCTuRDCFvX9NBh7IXwXWl2/hyxmcW S3SD9J8TRBalKqXLNoE7zjL9p7Llz5I/SSbrpEQQ202liFEqK/bqlgJUNX/8vYTWVjkf lDRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8LtGJFRoLm+1QViJT/TSBBPXd3MZMx440gcj2kcTdA4=; b=cH5euehgyJ24DDx0P4K8ChUK/3u1V6bZe+2xagLnDD2onKKpKCvyskwTzp9ME4VMVO SA6r5Fx68hv/BrYsqRuGUHICaZcE6kui5eUxCcGlPy0jXT93Dh6s7IJskn0toXC9Qeja HMS/VgnpBG3PvP3A2k1GorGMv4ppK0ZmQnjpyuJ5BJ83TQoh9bEuWqiLhzZjCJJOHaZJ z977ENCQz9q5ad8+IskETDg2NhytwUrl5eVN/7oVaIRQaNl/zhyX0pLFo0VLKiSAZJ3s UHJwPWAG2ivpLQpwXxZggyCJ8085ECAp8d2OSONoGO8dvpacEsVSUFekjVeiwoiEozXl u1jQ== X-Gm-Message-State: APjAAAVQdoTliDm5Jx2QqWPvF7nLt2xYdV/bfBRk5+QLI++UTh4GvpEJ bpoVvH2mMyOIQzKVC+2bYO9tX7BH X-Google-Smtp-Source: APXvYqy/Z+2Py4bryxprBQK1r7tzlXhDuL+n9PFjlwc5OSvUfaRZzVCcIsfcph9Pz8WVncG1rCwivw== X-Received: by 2002:a37:6794:: with SMTP id b142mr85101702qkc.216.1578335173136; Mon, 06 Jan 2020 10:26:13 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:12 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 45/59] 9pfs/9p.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:24:11 -0300 Message-Id: <20200106182425.20312-46-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Greg Kurz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label in v9fs_xattr_write() and 'out_nofid' label in v9fs_complete_rename() can be replaced by appropriate return calls. CC: Greg Kurz Signed-off-by: Daniel Henrique Barboza Acked-by: Greg Kurz --- hw/9pfs/9p.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 520177f40c..be2beba4cd 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -2464,8 +2464,7 @@ static int v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp, if (fidp->fs.xattr.len < off) { - err = -ENOSPC; - goto out; + return -ENOSPC; } write_count = fidp->fs.xattr.len - off; if (write_count > count) { @@ -2491,7 +2490,7 @@ static int v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp, off += to_copy; write_count -= to_copy; } -out: + return err; } @@ -3056,8 +3055,7 @@ static int coroutine_fn v9fs_complete_rename(V9fsPDU *pdu, V9fsFidState *fidp, if (newdirfid != -1) { dirfidp = get_fid(pdu, newdirfid); if (dirfidp == NULL) { - err = -ENOENT; - goto out_nofid; + return -ENOENT; } if (fidp->fid_type != P9_FID_NONE) { err = -EINVAL; @@ -3100,7 +3098,6 @@ out: put_fid(pdu, dirfidp); } v9fs_path_free(&new_path); -out_nofid: return err; } From patchwork Mon Jan 6 18:24:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218390 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IhG6pGWJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4Xv2QmNz9sR4 for ; Tue, 7 Jan 2020 05:58:39 +1100 (AEDT) Received: from localhost ([::1]:58192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXaG-0002gY-Oq for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:58:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46301) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX4y-0003S6-M2 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4x-00053c-FP for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:16 -0500 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:38170) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4x-00053I-BG; Mon, 06 Jan 2020 13:26:15 -0500 Received: by mail-qt1-x843.google.com with SMTP id n15so43213366qtp.5; Mon, 06 Jan 2020 10:26:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vLkBK5lSWEkB9UXmndWqWUlDLfAZMhVOoZ7WRef+Ig4=; b=IhG6pGWJ6BRiXdPk0rw3Kv9D6qGDfbd3ECSNZ2+sAA/tXxgRYiVztrJBDuz4WGFREC rIana4JBxaZVXnlLcelSckeO/sL4PJQol+dhSin85HPt0PgNL/LdAXk6jRr+ITE4DBpm 7pB063tzhD/thPSt/MjN4IlK7jUWwA8lOoi1IBnH9o6Umtg7a1wRxm8zbrq+xv9rDIFU TG8H1z/Yr2MTxFL3yP1QJLxdJBVNCBcuShcHnWF6VTQJsb/FTaAMclJQm9YZvzTqRQhU t7BU6m2tRWNUjNc8e3ZA9xyL1GYhMAU48VpZSa9TbIkhq+B/ft35pmeaPufAsXrP7LGo Dvgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vLkBK5lSWEkB9UXmndWqWUlDLfAZMhVOoZ7WRef+Ig4=; b=i3VcEkS7gBUCTfq45v8REy2BN//EcR9pynw+jpQ+bkkWnXJauZSra/RVkBh/dCvDON OY7BZPlhqSoK07NzvVwj3LHXy7VPOhNrKH7q7nWGR405tuHMfngcb5su8e8RjwBLuEkw 6Yl+8bto8cWV65s6JiEoYvyWnmEoT8C0j4xH1ICyABsiDbs/Ec7EXBAJazo2jj5cdR6J 5VlwFKiQLVjTiOM59hi6oU07y562KN/7VuU654CcV9+QaJRqpvxq1mxlLB2X7NWSIUq6 Jg00/LKQJvDzREB9H0IQjYlbGj6F4V18wI+AeP+YT09t4wYqqmQmPALsz7cGomLL+Lyp tH7g== X-Gm-Message-State: APjAAAXnsQjtRywKZ53m5Rqet+CBCKtHHGkbslsYRIrT8Gi9pzIsF+f2 26yAf68VjKU04ZjywPy2ZpTSWsBJ X-Google-Smtp-Source: APXvYqz0JY9smgLFPzAiiETwEw3EDaNA9DaxSXm2oBrDtCaChGrePUXVRbUAYfq3Q9hxG9/fYtO3tA== X-Received: by 2002:ac8:769a:: with SMTP id g26mr12100709qtr.259.1578335174763; Mon, 06 Jan 2020 10:26:14 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:14 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 46/59] alpha/typhoon.c: remove unneeded label in typhoon_translate_iommu() Date: Mon, 6 Jan 2020 15:24:12 -0300 Message-Id: <20200106182425.20312-47-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Label 'success' can be replaced by 'return ret'. As a bonus, existing trailing whitespaces were automatically deleted by the text editor while making this patch. CC: Richard Henderson Signed-off-by: Daniel Henrique Barboza --- hw/alpha/typhoon.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/alpha/typhoon.c b/hw/alpha/typhoon.c index 179e1f7658..af992883c7 100644 --- a/hw/alpha/typhoon.c +++ b/hw/alpha/typhoon.c @@ -34,7 +34,7 @@ typedef struct TyphoonWindow { uint64_t wsm; uint64_t tba; } TyphoonWindow; - + typedef struct TyphoonPchip { MemoryRegion region; MemoryRegion reg_iack; @@ -190,7 +190,7 @@ static MemTxResult cchip_read(void *opaque, hwaddr addr, case 0x0780: /* PWR: Power Management Control. */ break; - + case 0x0c00: /* CMONCTLA */ case 0x0c40: /* CMONCTLB */ case 0x0c80: /* CMONCNT01 */ @@ -442,7 +442,7 @@ static MemTxResult cchip_write(void *opaque, hwaddr addr, case 0x0780: /* PWR: Power Management Control. */ break; - + case 0x0c00: /* CMONCTLA */ case 0x0c40: /* CMONCTLB */ case 0x0c80: /* CMONCNT01 */ @@ -694,14 +694,14 @@ static IOMMUTLBEntry typhoon_translate_iommu(IOMMUMemoryRegion *iommu, /* Check the first three windows. */ for (i = 0; i < 3; ++i) { if (window_translate(&pchip->win[i], addr, &ret)) { - goto success; + return ret; } } /* Check the fourth window for DAC disable. */ if ((pchip->win[3].wba & 0x80000000000ull) == 0 && window_translate(&pchip->win[3], addr, &ret)) { - goto success; + return ret; } } else { /* Double-address cycle. */ @@ -711,7 +711,7 @@ static IOMMUTLBEntry typhoon_translate_iommu(IOMMUMemoryRegion *iommu, if (pchip->ctl & 0x40) { /* See 10.1.4.4; in particular <39:35> is ignored. */ make_iommu_tlbe(0, 0x007ffffffffull, &ret); - goto success; + return ret; } } @@ -723,16 +723,14 @@ static IOMMUTLBEntry typhoon_translate_iommu(IOMMUMemoryRegion *iommu, pte_addr = pchip->win[3].tba & 0x7ffc00000ull; pte_addr |= (addr & 0xffffe000u) >> 10; if (pte_translate(pte_addr, &ret)) { - goto success; + return ret; } } } } failure: - ret = (IOMMUTLBEntry) { .perm = IOMMU_NONE }; - success: - return ret; + return (IOMMUTLBEntry) { .perm = IOMMU_NONE }; } static AddressSpace *typhoon_pci_dma_iommu(PCIBus *bus, void *opaque, int devfn) From patchwork Mon Jan 6 18:24:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218396 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZdeMQ8UH"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4ZY0Hplz9sPK for ; Tue, 7 Jan 2020 06:00:05 +1100 (AEDT) Received: from localhost ([::1]:58210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXbe-00053x-8E for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:00:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46328) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX50-0003VQ-D0 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX4z-00055X-4F for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:18 -0500 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:44335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX4z-00055D-0m; Mon, 06 Jan 2020 13:26:17 -0500 Received: by mail-qk1-x741.google.com with SMTP id w127so40269614qkb.11; Mon, 06 Jan 2020 10:26:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5WuUZRHCzkwWxWtzKtgDX4yjtDTeyRFxW7kIUanwn6c=; b=ZdeMQ8UHGy9hLj8PGaHr7+C9CS/OBtbby1PzCL5s2mgv39PtzN33JHp18JaIperBym x2TCpieDr4KiqMD93kIaMu1kqKk7bkRvpylCn9mEJNuVKi7Ifno1sPwJX7qMQMvvapKr RZtiKkB3HatUEa60q8wMRIoaPhPcCzrNrLxZ1sDMEJuRx50wP/YmXUQhyUV4Sj1xo40P bKiFd0QYkWn3t8Dv4Hq/9y7SD9FtSyEz6sLmLeWgO0dzop/pZ6UIFVEzTNt5yJBLcBto VjX+ttm5VJvevbNX7j6JH5lLnrmdXwql9lvSC+FAjSqrwLkEBjQL3knp7ia4kaYfXteF edEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5WuUZRHCzkwWxWtzKtgDX4yjtDTeyRFxW7kIUanwn6c=; b=OzR02z0T9SGFMXJvwkManZKqzvDHuKWtkKPJtUCFHp/UoKyBwUaDiEAxxryELENYD5 KVHzHbUhKR6NwJ26i5oaa3/SCCx5nldklVnlrPQvgWxVxdlhpp+ArOAf0qMVOrsrXP1o dsyz+PsV09JgLd8Z7OUAYgO31vt1EzsFUYS5XJ4jPg7sYZzLmK6o0z8/1pYpOceOr6Lk mPqi5OYZ0cu+duaoeRJoQcDljP48giCs0dbbZbP9Y1YMRDNFMLqY2duD89/Adpp5vW34 FBLPdQVY+fOLnvTXjYv0L+6s7wFUXMoDdDQ7qSgiNZfuolVv2QjhYkHP3JxacgFRDOFS Dagw== X-Gm-Message-State: APjAAAXJ9lOSt5PaFmo9g2eDExYrAJQKPRmBFvLunLptHUDInFjiqdwt gmAMvGYSs5S1m0GOdcGizOrvuu5J X-Google-Smtp-Source: APXvYqxCy2hs/oidkSAxrapt51pghQzPFsLbYQUe1RGrC8YZUTyrg7kcIvafxKXgzgeM0igPdlRzdg== X-Received: by 2002:a37:c244:: with SMTP id j4mr82727323qkm.433.1578335176481; Mon, 06 Jan 2020 10:26:16 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:16 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 47/59] pvrdma_main.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:24:13 -0300 Message-Id: <20200106182425.20312-48-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Yuval Shaia Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Label 'out' from init_dev_ring() and load_dsr() can be replaced by 'return' with the adequate value. CC: Yuval Shaia CC: Marcel Apfelbaum Signed-off-by: Daniel Henrique Barboza --- hw/rdma/vmw/pvrdma_main.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c index 6f0fc405c7..fcaf829e30 100644 --- a/hw/rdma/vmw/pvrdma_main.c +++ b/hw/rdma/vmw/pvrdma_main.c @@ -94,8 +94,7 @@ static int init_dev_ring(PvrdmaRing *ring, struct pvrdma_ring **ring_state, dir = rdma_pci_dma_map(pci_dev, dir_addr, TARGET_PAGE_SIZE); if (!dir) { rdma_error_report("Failed to map to page directory (ring %s)", name); - rc = -ENOMEM; - goto out; + return -ENOMEM; } tbl = rdma_pci_dma_map(pci_dev, dir[0], TARGET_PAGE_SIZE); if (!tbl) { @@ -134,7 +133,6 @@ out_free_tbl: out_free_dir: rdma_pci_dma_unmap(pci_dev, dir, TARGET_PAGE_SIZE); -out: return rc; } @@ -177,8 +175,7 @@ static int load_dsr(PVRDMADev *dev) sizeof(struct pvrdma_device_shared_region)); if (!dev->dsr_info.dsr) { rdma_error_report("Failed to map to DSR"); - rc = -ENOMEM; - goto out; + return -ENOMEM; } /* Shortcuts */ @@ -221,7 +218,7 @@ static int load_dsr(PVRDMADev *dev) goto out_free_rsp; } - goto out; + return rc; out_free_rsp: rdma_pci_dma_unmap(pci_dev, dsr_info->rsp, sizeof(union pvrdma_cmd_resp)); @@ -234,7 +231,6 @@ out_free_dsr: sizeof(struct pvrdma_device_shared_region)); dsr_info->dsr = NULL; -out: return rc; } From patchwork Mon Jan 6 18:24:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218365 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="N7CNeotv"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4Jf1v2Wz9sPK for ; Tue, 7 Jan 2020 05:48:02 +1100 (AEDT) Received: from localhost ([::1]:58028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXPz-00057G-W2 for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:48:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46358) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX52-0003Zb-D7 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX51-00057q-9X for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:20 -0500 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:39322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX51-00057I-53; Mon, 06 Jan 2020 13:26:19 -0500 Received: by mail-qk1-x743.google.com with SMTP id c16so40279922qko.6; Mon, 06 Jan 2020 10:26:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bs7x1DdZtpqQKwEZE8GS4y2GJ9iZwDpJNAVLOudv4rU=; b=N7CNeotvXctrkrAGky6hUb3El8MgPub51aUw6VZiMIVZL9tyQ7kP52weIeQagDaSVv bD6qcCwLE1gJpKw0hKxyV8P/NyYX5PmC49IIGRfzEUpTWcZ32GsXhJHXbiM89WBF+oxJ QnGv5K6lPy//8DEBPf0mb4YggELTgr3nAUBojHGjmNfUzYYESzzsMwpE95ohNoIDAxVq sC9v3rQgsBBPv2CAp/r2oOZU4nDrtWuGigu7TOgEoYxGox794Zya2DhVwibpXC563vmj 6rRgdw7vpGFwDaboG+LmNNSP1Jh+cSrG9FoHVlvCAQdFjxqoT/P5DwnVUemFfJsPNccO LdGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bs7x1DdZtpqQKwEZE8GS4y2GJ9iZwDpJNAVLOudv4rU=; b=Mdq14J1FB1T/m3YPTw63A0HwT11L4gUOQW8YDIK5Oom1Yp32necOkOToU9qrbyUYus 8GIaANr9M5LPwWigvLqwGReVRdWRvfUW4t9sUasXW59/CsmGx7maHNU/MZLQ163o8IIN V6H1l4JIEgYRfw/7g4hCTxjuhnpYBkSKWmuySk15hY9gptPfuw7hW7b01gtEe1i7brea UNETHmcCcXKhm4vEps13MFVRS8LV5BvROvQZhZw9ZlqA6GmX8ZM8JStAejVlcxDmgltQ +5f2Ls9KDSOPGNQ2HL7ulImxyEARn7oEYTsJnqgrtZ+eKXZi4d/ol9wATcFUWvzcvwq/ TsFw== X-Gm-Message-State: APjAAAXjwdf/dA7ebJ8Kf/59AgDTzOVxL+wHeSJhDgT3/4GvuCFNfvpX eMZATHqXhwEwBR9nhRjKn21Mj4eT X-Google-Smtp-Source: APXvYqwp57AWDJiUhXtstFk6McUIumDhjnvSPpEl2+ee+XmFqCQ7VRFp/LZ+b+CsrS76H3AIMpI7wg== X-Received: by 2002:a37:6346:: with SMTP id x67mr83721219qkb.476.1578335178367; Mon, 06 Jan 2020 10:26:18 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:18 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 48/59] pvrdma_dev_ring.c: remove unneeded label in pvrdma_ring_init() Date: Mon, 6 Jan 2020 15:24:14 -0300 Message-Id: <20200106182425.20312-49-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Yuval Shaia Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label can be replaced by 'return' with the right return value. Since the 'rc' var was being used just to set -ENOMEM in a single error condition, get rid of the var and set the return value directly in the 'return' call. CC: Yuval Shaia CC: Marcel Apfelbaum Signed-off-by: Daniel Henrique Barboza --- hw/rdma/vmw/pvrdma_dev_ring.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/rdma/vmw/pvrdma_dev_ring.c b/hw/rdma/vmw/pvrdma_dev_ring.c index d7bc7f5ccc..c2ecce3b41 100644 --- a/hw/rdma/vmw/pvrdma_dev_ring.c +++ b/hw/rdma/vmw/pvrdma_dev_ring.c @@ -28,7 +28,6 @@ int pvrdma_ring_init(PvrdmaRing *ring, const char *name, PCIDevice *dev, size_t elem_sz, dma_addr_t *tbl, uint32_t npages) { int i; - int rc = 0; strncpy(ring->name, name, MAX_RING_NAME_SZ); ring->name[MAX_RING_NAME_SZ - 1] = 0; @@ -51,14 +50,13 @@ int pvrdma_ring_init(PvrdmaRing *ring, const char *name, PCIDevice *dev, ring->pages[i] = rdma_pci_dma_map(dev, tbl[i], TARGET_PAGE_SIZE); if (!ring->pages[i]) { - rc = -ENOMEM; rdma_error_report("Failed to map to page %d in ring %s", i, name); goto out_free; } memset(ring->pages[i], 0, TARGET_PAGE_SIZE); } - goto out; + return 0; out_free: while (i--) { @@ -66,8 +64,7 @@ out_free: } g_free(ring->pages); -out: - return rc; + return -ENOMEM; } void *pvrdma_ring_next_elem_read(PvrdmaRing *ring) From patchwork Mon Jan 6 18:24:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218423 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rfk3Gxix"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4wZ6HLxz9sQp for ; Tue, 7 Jan 2020 06:15:42 +1100 (AEDT) Received: from localhost ([::1]:58658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXql-0002aR-VS for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:15:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46377) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX53-0003bn-Mg for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX52-00059A-Kv for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:21 -0500 Received: from mail-qk1-x742.google.com ([2607:f8b0:4864:20::742]:41166) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX52-00058q-HE; Mon, 06 Jan 2020 13:26:20 -0500 Received: by mail-qk1-x742.google.com with SMTP id x129so40279646qke.8; Mon, 06 Jan 2020 10:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fAxjxUHh9JaiR6VmZW01ZkN0LXgZJSoQuf5vn+XIRdw=; b=rfk3GxixlysDr45BPkf2u2KqFAkKa0GmFiVAVKpJUP4Zr8BnRwQLCwkXm0c0y///bt mBMNXqNMOLIo1T8xLwqHx6GiexrLw7h+v+9OKOhPSEsZXzRt0xWxajGjyY1HgCohi6Yv 4xBnd4pcnK5rrg9tuEyFoOD6zSmBuE8YCn6CgXYcYIeQbs04UB89nVeg4cpIV2N3+YmR HQMjfPdl4KxMPKMjXi9MWFCJhBcRp7pBorZOlSke4orsAG1l7ztNlHJ4Mj2NklPwBA33 IrdcbWT17kPDvYy0kt//+pGymVrEOdkQZs/mQf8TZzmQvnnjI9Dz6XK2LBw5hvrsCNgn fCfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fAxjxUHh9JaiR6VmZW01ZkN0LXgZJSoQuf5vn+XIRdw=; b=SkHXXHOxRdescD8MmAsCXMQYd130AXc8S64fevrve2SkKf/bZ658vUzhnjVMB1Um3z 6NjUF3MVtvS8DvRNcllWgblKtAeM3ItcUN++LjffUW/xqZ5WQHjZri+uoJomyco0/jZY AFpg8dMTH55Z6UO2lCYZVDHkpyrPnxURAe/uNv+n9iXymXmJECI59rG2ecNLql768ual sxZ0btppyBCjEO5YOfG8Th1YNUAZWayySnZUyBAaqKYmhhQo3lubrs8jSPSFDZ3tiTFp 8pq04GfYM+B998MQpG5wCDr38wxe4j0HT8AgAVTgWSW9L0s1pZQp92HO4pZDlONkuWPp 9Q3w== X-Gm-Message-State: APjAAAW0OhQPASEb6/OXrnDVXCzMCGP/bNtOH9I7Ntb2efuqrZvSicDY rg2jsZoPSRcyf6D0KAqXpcOIjpMN X-Google-Smtp-Source: APXvYqw/aCh3zfgRbSaEj6maI+tanxesOlhxR/XyK5a1KtVEXQzovhATZA+9ouabFCdOpv4Gm3edbQ== X-Received: by 2002:a05:620a:139b:: with SMTP id k27mr83022316qki.112.1578335179982; Mon, 06 Jan 2020 10:26:19 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:19 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 49/59] rdma/rdma_rm.c: remove unneeded label in rdma_rm_alloc_pd() Date: Mon, 6 Jan 2020 15:24:15 -0300 Message-Id: <20200106182425.20312-50-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::742 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Yuval Shaia Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label can be replaced by 'return ret'. Since 'ret' will be set to -ENOMEM in 'goto' time, we can replace it to 'return -ENOMEM'. After this change, the 'ret' var is used to store the result of rdma_backend_create_pd(), see if it's not zero, then 'ret' is set to -EIO before the jump to out_tbl_dealloc. -EIO is the only error being thrown by out_tbl_dealloc too. This means we can go a step further in the code simplification by also removing the 'ret' variable and making out_tbl_dealloc return -EIO directly. CC: Yuval Shaia CC: Marcel Apfelbaum Signed-off-by: Daniel Henrique Barboza --- hw/rdma/rdma_rm.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c index 1524dfaeaa..f049fda38a 100644 --- a/hw/rdma/rdma_rm.c +++ b/hw/rdma/rdma_rm.c @@ -161,16 +161,13 @@ int rdma_rm_alloc_pd(RdmaDeviceResources *dev_res, RdmaBackendDev *backend_dev, uint32_t *pd_handle, uint32_t ctx_handle) { RdmaRmPD *pd; - int ret = -ENOMEM; pd = rdma_res_tbl_alloc(&dev_res->pd_tbl, pd_handle); if (!pd) { - goto out; + return -ENOMEM; } - ret = rdma_backend_create_pd(backend_dev, &pd->backend_pd); - if (ret) { - ret = -EIO; + if (rdma_backend_create_pd(backend_dev, &pd->backend_pd)) { goto out_tbl_dealloc; } @@ -180,9 +177,7 @@ int rdma_rm_alloc_pd(RdmaDeviceResources *dev_res, RdmaBackendDev *backend_dev, out_tbl_dealloc: rdma_res_tbl_dealloc(&dev_res->pd_tbl, *pd_handle); - -out: - return ret; + return -EIO; } RdmaRmPD *rdma_rm_get_pd(RdmaDeviceResources *dev_res, uint32_t pd_handle) From patchwork Mon Jan 6 18:24:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218369 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Vr1DbhI/"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4ND5NL4z9sPK for ; Tue, 7 Jan 2020 05:51:08 +1100 (AEDT) Received: from localhost ([::1]:58080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXSy-0000eo-Px for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:51:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46403) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX55-0003ex-Je for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX54-0005Am-Lo for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:23 -0500 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:44338) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX54-0005AX-I5; Mon, 06 Jan 2020 13:26:22 -0500 Received: by mail-qk1-x743.google.com with SMTP id w127so40269883qkb.11; Mon, 06 Jan 2020 10:26:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JP7yRAv3JFqhY7+OM2TlYk8mkn5EeN/uOmT4fxUErEA=; b=Vr1DbhI/ySi+nSz1J3b1Vz6TDDueqfUI5kWiNnFHtX+b77uUHqpAd02mmjG30yN1AQ ZxRuPfiL8EN6Uwr1kZYQU76VHMFnAlR07gdPcK91D9sXGRjgT3x292tpMES0e7iwbXYs wmkuamyCyCBvRSxASDKoJ+4V0wH1dtYxVE14TzYhWZzhGqPyG4JeprB32MXbULns40Ck xhHINx2ofieHYO9vLJGW1D0iBdOkJLHi2j/tqJqEKUb/BoIBeS8jBRFVfGcKKZvARmQG SCqAgUuEzNlnRT0PX7kv7tAWXVlMr7hc8lNNEpddZ36aK07TLvKXr+Dombf7XSDMz6Du bduw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JP7yRAv3JFqhY7+OM2TlYk8mkn5EeN/uOmT4fxUErEA=; b=PT2WCj1aoX89TwUmDZHoTp+nGad+IcU4GE5TpJ6g/RJmO58e1kUtbxHO/LAuROSvnL WOhJmpfFl/fdbfemyKio75+HR9r/X7hB/EfI2xbLWXUxWv6CUIMDiUhap77kZkANu7zZ nXFA0DXDlkUpl6RGbD+4iIjDtLy2U/yoowlOeBuQr+7ilAHa46Av+GmMGZBMEUOF+LM0 hEppsoN81583TOqyZuoYYNNJS3uRrYQmIe2NGXnXPZqXlC7g1dLXCdVg8PAlU4h8wdu5 +6v7wFphUQBfHxB24nL367BAW2MoSiVu36fxVYNgaeFaP3k1hFfMS3mYdmUZRap/XyyT dnVQ== X-Gm-Message-State: APjAAAUOv/G4BY7wvKR6RzwQMpGRIDkqWrQH9q2uUjYrioVdmr+25mO5 ExAEMhstZat96krQ5txBbM2ZBZ2t X-Google-Smtp-Source: APXvYqy7eHx3DNdyUi8FeIpvryybTYEiqNapfd+kmM0ClNOuRVHCPX1NE2URNksuTXzckQsorG3jZA== X-Received: by 2002:a05:620a:b04:: with SMTP id t4mr86335470qkg.7.1578335181943; Mon, 06 Jan 2020 10:26:21 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:21 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 50/59] rdma/rdma_backend.c: remove unneeded label in rdma_backend_init() Date: Mon, 6 Jan 2020 15:24:16 -0300 Message-Id: <20200106182425.20312-51-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Yuval Shaia Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label can be replaced by 'return -EIO' in the single goto jump. CC: Yuval Shaia CC: Marcel Apfelbaum Signed-off-by: Daniel Henrique Barboza --- hw/rdma/rdma_backend.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index c346407cd3..20c4c9fc3a 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -1335,8 +1335,7 @@ int rdma_backend_init(RdmaBackendDev *backend_dev, PCIDevice *pdev, if (!backend_dev->context) { rdma_error_report("Failed to open IB device %s", ibv_get_device_name(backend_dev->ib_dev)); - ret = -EIO; - goto out; + return -EIO; } backend_dev->channel = ibv_create_comp_channel(backend_dev->context); @@ -1377,7 +1376,6 @@ out_close_device: out_free_dev_list: ibv_free_device_list(dev_list); -out: return ret; } From patchwork Mon Jan 6 18:24:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218373 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lJTUv7Ey"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4RT4js6z9sPK for ; Tue, 7 Jan 2020 05:53:57 +1100 (AEDT) Received: from localhost ([::1]:58108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXVj-0004Pc-5v for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:53:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46423) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX57-0003hV-9J for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX56-0005C0-76 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:25 -0500 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]:38127) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX56-0005Br-3j; Mon, 06 Jan 2020 13:26:24 -0500 Received: by mail-qk1-x744.google.com with SMTP id k6so40299199qki.5; Mon, 06 Jan 2020 10:26:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R4+oVQB+J193/KmZY8maPFyIkwwRtaLrd/XP0/x5tOE=; b=lJTUv7EyIfaLsTN5YiW7f9v/wG/JJh69AI5ZjAmTOHkILFITpsXHBbgiT6QV46Th2R CvpoZUSu2wMpM0qQvkd4HpVbVgaBD7gnQu6L4lGy3FvsuBuxS03z+zt3iWWGw0YwpQea ofQlFWcgiIP2CaP7eZ5S5gb0PgL+qP9J0emZT8ks8PSRifrR9q7w0JOLxBbKGTR1xiDG J7S2DZu1SWbqI++IWL+ponIlciRb2mlzuGm7o7lvNghx9SA8y5gTlzzuzccnNqArW89I jCKZdvbDGn19pfOEXxsnNGV3Bumx/5ZOGFgdtECvO/ob+xlyTuO+S3eImsdU/8+7Q4W/ w2pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=R4+oVQB+J193/KmZY8maPFyIkwwRtaLrd/XP0/x5tOE=; b=q8IHPmM/U6+D7JCSvWzbQwOHG0HCPM5EW6d4cQ++JmWBckbvbticyLsQDFWy6UK8BY MzfpkqsIw2Nsx4+3xWFWfQL7EH2UqNuKtrwWsKpaIYVpbrEKLa/rffH7BxLCJJ6HmSH9 +RI/udpWYef/btz1crgE9/IRlD+/YUY/DyhXN54rCuAYtmFJROhFpFD2r+SFtINzzPa1 rruK2VS3q+0BDXyr8VsxkTKcFlw5SFzgW7zZK3Z62PXO+1vDE9vGwv6hbI36CmwvOp/F S9X7Y+/XnsSlN49XDUiPCZ7/ywQxt0blIwP1k3PRyLWYep3pIYOw4pue9IDH0K6ZpRJM CBjg== X-Gm-Message-State: APjAAAXgEIAfonpRO1En/tuVT7r5gnTKMbQFWVKEqgjTye7dOHNnSvrT hYy65iqW/u/+wYmysQWeUF6vdoNI X-Google-Smtp-Source: APXvYqzec/GMmFqXRPQVV5bOLUXpecEJ5+Z8cAxYziv1UxICY9ICN8PR8HGeALoUM8DDd22rXBKH8Q== X-Received: by 2002:a37:8e03:: with SMTP id q3mr82847731qkd.395.1578335183533; Mon, 06 Jan 2020 10:26:23 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:23 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 51/59] virtio/vhost.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:24:17 -0300 Message-Id: <20200106182425.20312-52-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::744 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The label 'err_features' in vhost_dev_set_log(), 'out' in vhost_device_iotlb_miss() and 'fail' in vhost_dev_enable_notifiers() can be replaced by 'return' with the appropriate value. CC: Michael S. Tsirkin Signed-off-by: Daniel Henrique Barboza --- hw/virtio/vhost.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 4da0d5a6c5..7b36839221 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -774,7 +774,7 @@ static int vhost_dev_set_log(struct vhost_dev *dev, bool enable_log) int r, i, idx; r = vhost_dev_set_features(dev, enable_log); if (r < 0) { - goto err_features; + return r; } for (i = 0; i < dev->nvqs; ++i) { idx = dev->vhost_ops->vhost_get_vq_index(dev, dev->vq_index + i); @@ -792,7 +792,6 @@ err_vq: dev->log_enabled); } vhost_dev_set_features(dev, dev->log_enabled); -err_features: return r; } @@ -938,7 +937,7 @@ int vhost_device_iotlb_miss(struct vhost_dev *dev, uint64_t iova, int write) trace_vhost_iotlb_miss(dev, 3); error_report("Fail to lookup the translated address " "%"PRIx64, iotlb.translated_addr); - goto out; + return ret; } len = MIN(iotlb.addr_mask + 1, len); @@ -949,13 +948,12 @@ int vhost_device_iotlb_miss(struct vhost_dev *dev, uint64_t iova, int write) if (ret) { trace_vhost_iotlb_miss(dev, 4); error_report("Fail to update device iotlb"); - goto out; + return ret; } } trace_vhost_iotlb_miss(dev, 2); -out: return ret; } @@ -1356,7 +1354,7 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev) r = virtio_device_grab_ioeventfd(vdev); if (r < 0) { error_report("binding does not support host notifiers"); - goto fail; + return r; } for (i = 0; i < hdev->nvqs; ++i) { @@ -1380,7 +1378,6 @@ fail_vq: virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index + i); } virtio_device_release_ioeventfd(vdev); -fail: return r; } From patchwork Mon Jan 6 18:24:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218387 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ViZJtqqC"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4VT3zmdz9sPK for ; Tue, 7 Jan 2020 05:56:33 +1100 (AEDT) Received: from localhost ([::1]:58154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXYE-0008Im-Q7 for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:56:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46449) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX59-0003lH-38 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX58-0005DM-0C for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:26 -0500 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]:42555) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX57-0005D7-Sm; Mon, 06 Jan 2020 13:26:25 -0500 Received: by mail-qk1-x743.google.com with SMTP id z14so39016754qkg.9; Mon, 06 Jan 2020 10:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0v81XTgpe39UJaMXds5mD2XgR/7Ua6QyU6w1mwdmCXM=; b=ViZJtqqCIYXTcWLD/22pFaG95qUlFyo49tNVAh+CDYXLpd9LYH7KX/BQYcvqDs/yUi ik/p6lx3qUPTq4i6XbhwIxEjo8Sd+AgnpNeWJbdMu1MBqfIUeECHbHUT0L3oqopUTsvm o9VrmlLYUvA1OjLMlG8wYNlmzCMOfjUnqO/ZZO7sCCVrG7QCmVLb8oqR9ctL+P40BQSg jxXaw3ci7t+pcuwoIuV20wJ7sESgk7Vr0KXzpwuvI8rz92+CcDALJWQlYkcYBL6W6zDh /7UjsAO/YcG18Ne8i5epZN3bVZ9L0FnV0hkK1KpHhSMh6Pd3JDkOu8Kia8eBV5kbx4cq xjSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0v81XTgpe39UJaMXds5mD2XgR/7Ua6QyU6w1mwdmCXM=; b=IvujFk0Scgxtfew7ZG9UZKqfl2TC5gh8tDomOQCheeLQ4dMiY1z1vB1NsFWo7MRbbV d/H/0sxHru5i55QhIpnKkGtqzWSoa2qWoGZkx3C1tF/pYJtmBzKLSy7eVgjG9Q7LbCUV F+L728bJbRs2SyV3wOYhgHwjij60GNob1zaFX4S/v2I79DzjDElezPJcF+/x0RbWOdXn ebjeD9KrpuMnsrFN3yM0F/oRHSlKb8yMVK9bGG0YGXOlS9K8hbCD5Bo5sXRhFOPr+QCO r1Cam5SMTKxV4wWSa9tFJue/8VyP125krpYlxfOoFTfzGcd1mxGKfgAflgkggUiRvfN6 aiYw== X-Gm-Message-State: APjAAAUqJi36Row61Wnu8IvsExNcCrhS25q5vxrKNEa55Y2+qpWlmmcs M+G4g1T2gawhecxMZkNERUvP4pYE X-Google-Smtp-Source: APXvYqy9QOYrdk3Drvow6+RkYXXFtLZ8YsGNL4zUxm54gTZBLULiM8QInD8M5hYvmyXCmFTkggQkEw== X-Received: by 2002:ae9:f711:: with SMTP id s17mr83113900qkg.238.1578335185353; Mon, 06 Jan 2020 10:26:25 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:25 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 52/59] net/vhost_net.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:24:18 -0300 Message-Id: <20200106182425.20312-53-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::743 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Label 'fail_notifiers' in vhost_net_start_one() and 'err' in vhost_net_start() can be replaced by 'return r'. CC: Michael S. Tsirkin Signed-off-by: Daniel Henrique Barboza --- hw/net/vhost_net.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index 6b82803fa7..272519f970 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -230,7 +230,7 @@ static int vhost_net_start_one(struct vhost_net *net, r = vhost_dev_enable_notifiers(&net->dev, dev); if (r < 0) { - goto fail_notifiers; + return r; } r = vhost_dev_start(&net->dev, dev); @@ -278,7 +278,6 @@ fail: vhost_dev_stop(&net->dev, dev); fail_start: vhost_dev_disable_notifiers(&net->dev, dev); -fail_notifiers: return r; } @@ -331,7 +330,7 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, r = k->set_guest_notifiers(qbus->parent, total_queues * 2, true); if (r < 0) { error_report("Error binding guest notifier: %d", -r); - goto err; + return r; } for (i = 0; i < total_queues; i++) { @@ -362,7 +361,7 @@ err_start: fprintf(stderr, "vhost guest notifier cleanup failed: %d\n", e); fflush(stderr); } -err: + return r; } From patchwork Mon Jan 6 18:24:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218392 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XepBHbRc"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4YQ439vz9sRR for ; Tue, 7 Jan 2020 05:59:06 +1100 (AEDT) Received: from localhost ([::1]:58200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXah-0003Tc-5F for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 13:59:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46478) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX5A-0003oe-Pz for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX59-0005Ey-M0 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:28 -0500 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:33026) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX59-0005Ed-Ik; Mon, 06 Jan 2020 13:26:27 -0500 Received: by mail-qk1-x741.google.com with SMTP id d71so32446953qkc.0; Mon, 06 Jan 2020 10:26:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JJWYjaXsWA8uSjmMFIfhA7Z1i5kUfBIKlMWt+XL7NrA=; b=XepBHbRcdoMRwO/gywlmTxjNi0ImO5cPV4DtOK1NSPJGEfrf8JEDe0NrCB4TaMx9v2 gnrkoe6RF42aFys5F9Ukvws0ZF8e5DXACSzyTa0p0XR3RCF1t/414Yo649bJstTeBEop fBc/75GDTZKOismSWmAKMBj5KKDi1NsRnK69joXE2lkeNAy6a6kXfbCRnGR0r/YOFAUH 1MXbUWMCMTuVyAbd+f/8uRuU4ToXh+nS88I6kjOwX2r18ta46hzA1FYzOYN0RZMPxJ4o Fd//G+Sij6PXgvhnpzyr8GhsjgY2UavIx07s5wBkxd1LbWNDiQ3owxKWxCQuUT6TrQ64 5V2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JJWYjaXsWA8uSjmMFIfhA7Z1i5kUfBIKlMWt+XL7NrA=; b=gjemjH1oQ2bWRVZBL+Aut+GJOOJv80XijT/moGCwR4qCH9bwBxRKg6Dspqxl+NwLsw 7W03nWf2tHzRUYJUm79qdgrPEQu8RpgIdphMxdeYB6qgENy28mT/YyVmPNm643VlS3vM GNekJpddfMZuS9dT37Nx0q2iCxVNmbAYnrzvmkqFl/1Z3I9edhRjJAPD70yEJIYCeL2E GqYOU9OV/jYmV/CR7cOlEkjknnSuq0s6R8v62vs0G1mwySmgOZJLhPt2cK1ZTzzb0EmE yKRYc5aeNvxNxioqvdXSmwWyslv8rAEp+XnY53THfQLFFUDl1Jpcxj1Vl2TlHKuYFPWW 4MaQ== X-Gm-Message-State: APjAAAXMywTwwQ9YIagzDTQbUlq/HyEZVSXnd2D2ddCslN4whXxtauga Xy1+9GuF84tXDWZhkIBFq8HzRW9F X-Google-Smtp-Source: APXvYqyvzVhyJMExc/vZgKmVGSOiey8uffmAAxbMnZ4hCmyLPBsiUp1omZBy6qvRrKZ6Kt3Av2xXgw== X-Received: by 2002:a37:6794:: with SMTP id b142mr85102518qkc.216.1578335187051; Mon, 06 Jan 2020 10:26:27 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:26 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 53/59] net/net_tx_pkt.c: remove unneeded label in net_tx_pkt_get_gso_type() Date: Mon, 6 Jan 2020 15:24:19 -0300 Message-Id: <20200106182425.20312-54-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::741 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza , Dmitry Fleytman Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'func_exit' can be replaced by 'return' with the appropriate return value. 'rc' also becomes unnecessary after this change, thus let's remove it as well. CC: Dmitry Fleytman Signed-off-by: Daniel Henrique Barboza --- hw/net/net_tx_pkt.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c index 162f802dd7..3cd6aa1d0e 100644 --- a/hw/net/net_tx_pkt.c +++ b/hw/net/net_tx_pkt.c @@ -287,21 +287,18 @@ struct virtio_net_hdr *net_tx_pkt_get_vhdr(struct NetTxPkt *pkt) static uint8_t net_tx_pkt_get_gso_type(struct NetTxPkt *pkt, bool tso_enable) { - uint8_t rc = VIRTIO_NET_HDR_GSO_NONE; uint16_t l3_proto; l3_proto = eth_get_l3_proto(&pkt->vec[NET_TX_PKT_L2HDR_FRAG], 1, pkt->vec[NET_TX_PKT_L2HDR_FRAG].iov_len); if (!tso_enable) { - goto func_exit; + return VIRTIO_NET_HDR_GSO_NONE; } - rc = eth_get_gso_type(l3_proto, pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base, - pkt->l4proto); - -func_exit: - return rc; + return eth_get_gso_type(l3_proto, + pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_base, + pkt->l4proto); } void net_tx_pkt_build_vheader(struct NetTxPkt *pkt, bool tso_enable, From patchwork Mon Jan 6 18:24:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218399 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="tD4lcCRN"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4dG0CYGz9sR8 for ; Tue, 7 Jan 2020 06:02:26 +1100 (AEDT) Received: from localhost ([::1]:58260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXdv-0007U5-An for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:02:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46502) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX5C-0003s1-8D for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX5B-0005GD-8S for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:30 -0500 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:43232) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX5B-0005Fy-4z; Mon, 06 Jan 2020 13:26:29 -0500 Received: by mail-qv1-xf42.google.com with SMTP id p2so19408978qvo.10; Mon, 06 Jan 2020 10:26:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JQxTRPnPlhXn/y/TL9t8metwExxAfIfNbs5Qew1wUwQ=; b=tD4lcCRN/yapUlr0QvtqVHeZ6aifJvSjso4C98TRGStU6v5qr34PW2eVaHPgO+DXdK Q4sDCoimJ3eLNhiSpplK8TKYuubQRE35M7vOTPI1MWLGlmh4hhlGmDZ9sf8MJd5BXISC usm62KGtedERfjrr7Q3gXRrm4iiiMyZhAgj05V+BkjAp6u07HHgF8+/G5Qt+z/pV+WtD ailQ3yyxCzdzTX3Bv5yfZhHVr6JEA7Kk3Lh19Y+Bsusu8Pf5uka+l6KhGk7u2Z62XZjx N6lBJJwXEAPjjH8GRlYkRmogKphX3dw88lA1pGng5TdWlktmwTOXRAaYWW6Exw+ZZ5AG T75A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JQxTRPnPlhXn/y/TL9t8metwExxAfIfNbs5Qew1wUwQ=; b=XfWTX5fo1/1nLJsUxu1OXS/aOEioJMb/m0YUZnMJGBcsbd0rgPYpqCr88ZpLmAu32u Vzqe4s/1F/BDeeTu+finyaKXFdNv5N4Z2A3FXbibS7gVugotBcIprbjBc22uHwzCx+jM 5oEPEnrstlSD89ayzuwz/leWn0i3WTJ//zemjRWYWSeQ7D8xXPipw9GLvv2FPETsRKTE Yyhyrvi+V9Dm7iVv/yocVHj7L6PmdmQLQQxycaLvfl/MoCm9UGaS7Zk+DmRl7ouNSMKk UnKsWrhrijfOjkT0Z04dnh3dE3QrsZs0/NjrmyO2QZ77Gc3vdi5O7pDQTCFqgpI9XDRM IDiA== X-Gm-Message-State: APjAAAXV34tFwZYEQpg0VUii+x9JTXlhdxJI0xL5V/7Nukzk4XlU6qkP 4dvClbPUvANCXHQ+EeUlxZV0/5g1 X-Google-Smtp-Source: APXvYqwxzpST7Aq/bU8yDjkptRfPj1gmygJph2a1ZL8w3deaE1bHYZ89DjZ8XuKU8V4IXlaKzZap7Q== X-Received: by 2002:a0c:ed32:: with SMTP id u18mr81340466qvq.2.1578335188543; Mon, 06 Jan 2020 10:26:28 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:28 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 54/59] ivshmem-server/main.c: remove unneeded label in main() Date: Mon, 6 Jan 2020 15:24:20 -0300 Message-Id: <20200106182425.20312-55-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f42 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Daniel Henrique Barboza Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'err' can be replaced by 'return 1'. Signed-off-by: Daniel Henrique Barboza --- contrib/ivshmem-server/main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/contrib/ivshmem-server/main.c b/contrib/ivshmem-server/main.c index e4cd35f74c..b491e8237f 100644 --- a/contrib/ivshmem-server/main.c +++ b/contrib/ivshmem-server/main.c @@ -217,7 +217,7 @@ main(int argc, char *argv[]) if (sigemptyset(&sa.sa_mask) == -1 || sigaction(SIGPIPE, &sa, 0) == -1) { perror("failed to ignore SIGPIPE; sigaction"); - goto err; + return 1; } sa_quit.sa_handler = ivshmem_server_quit_cb; @@ -226,7 +226,7 @@ main(int argc, char *argv[]) sigaction(SIGTERM, &sa_quit, 0) == -1 || sigaction(SIGINT, &sa_quit, 0) == -1) { perror("failed to add signal handler; sigaction"); - goto err; + return 1; } /* init the ivshms structure */ @@ -234,13 +234,13 @@ main(int argc, char *argv[]) args.shm_path, args.use_shm_open, args.shm_size, args.n_vectors, args.verbose) < 0) { fprintf(stderr, "cannot init server\n"); - goto err; + return 1; } /* start the ivshmem server (open shm & unix socket) */ if (ivshmem_server_start(&server) < 0) { fprintf(stderr, "cannot bind\n"); - goto err; + return 1; } /* daemonize if asked to */ @@ -269,6 +269,5 @@ main(int argc, char *argv[]) err_close: ivshmem_server_close(&server); -err: return ret; } From patchwork Mon Jan 6 18:24:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218397 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C8Pjl3ZA"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4cc2lXFz9sPn for ; Tue, 7 Jan 2020 06:01:52 +1100 (AEDT) Received: from localhost ([::1]:58230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXdN-0006XO-20 for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:01:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46529) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX5E-0003vm-2s for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX5D-0005He-0u for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:31 -0500 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:33225) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX5C-0005HQ-Th; Mon, 06 Jan 2020 13:26:30 -0500 Received: by mail-qv1-xf41.google.com with SMTP id z3so19447673qvn.0; Mon, 06 Jan 2020 10:26:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EhZ2N0Be93JJ38Lc58rqaW3YyswF78lbGstMwnrxgGM=; b=C8Pjl3ZAR7uxcNb2WC2cD7a0IyfpVUGS7udsCxa1RgktzSShtaiYwsCBaTnalFM3p4 pXFWMXSmRtC1pANYIMNlxv4/a+iPhvKTDKB/IanhJc6mCR9BOzXYYjrNX1gUCmvOow3j aZ1QK0805WfMtxzDZw642f8eE+f1XkvmJTIz57zAGBrCPoazVugJEjWek8sB2glAaAtK cAPiBbQO+pkAkgJ0rHSKk/bXWPFVbeVWKCXwBShCx41fKR2HripZ2t4g2VkKp0YBLMWd SiIsHCO1rjBcrLEtAgfPq9sNYOlldhnH0ed5jL1mP2Oerp9ZiLUAk4FK81IdbuWU1kQe TeTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EhZ2N0Be93JJ38Lc58rqaW3YyswF78lbGstMwnrxgGM=; b=mkrTA2wHd3NOO8zgCvQYESPl1qhemdMWudt/TJ0OCXf5wGcZ+3Uck5XjNI31p/DpIy VpAdUwODLl1rLkEgVwuAl7b/VG0EaYIJ3iHqqWTWrvm2d9TSfw1JLJCk4+NklGJt30z7 B5DHiu/xY0k/7O42KZYex3KiP5PC2hRO+o6z7BQOGVOdiX9QqTYOD4fDJWMYkK9qur5R RxS1YRqHjDdI5gShH2rWBfoDSAptM4igzZXbsiysopxV6f+swezCHXq3v4Bcyk03QJf6 RQyR2aXQw9PO36/ydBHwmhQHJTsPsybi/U+oPiGbMdXIhut1vkJu2JVgnZAST6Hjnqs7 rpsA== X-Gm-Message-State: APjAAAXqovCsO2YjOF2mX2RqLlH6qwQ2FSyptvE+gkUxmr2FMx3c7FR9 BZ7YM/E1VxD+e2DwcceOA9ZRybpf X-Google-Smtp-Source: APXvYqw7lVxB1o+8CAoAA6lKB+gAA0an9W9BtgAWkHWtYxNXwFKkIXd3FIPrxT20ebCZz5Xn0KuW4Q== X-Received: by 2002:ad4:58e1:: with SMTP id di1mr65553062qvb.201.1578335190371; Mon, 06 Jan 2020 10:26:30 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:30 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 55/59] linux-user/flatload.c: remove unused 'out' label Date: Mon, 6 Jan 2020 15:24:21 -0300 Message-Id: <20200106182425.20312-56-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f41 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Riku Voipio , Daniel Henrique Barboza , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' label in out_free_buf() is not used at all. CC: Riku Voipio CC: Laurent Vivier Signed-off-by: Daniel Henrique Barboza --- linux-user/flatload.c | 1 - 1 file changed, 1 deletion(-) diff --git a/linux-user/flatload.c b/linux-user/flatload.c index 0122ab3afe..3945c40ee1 100644 --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -247,7 +247,6 @@ out_free_buf: kfree(buf); out_free: kfree(strm.workspace); -out: return retval; } From patchwork Mon Jan 6 18:24:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218424 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CtGRoI1E"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4yk4pXnz9sQp for ; Tue, 7 Jan 2020 06:17:34 +1100 (AEDT) Received: from localhost ([::1]:58710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXsa-0004mv-Fo for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:17:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46560) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX5G-0003zz-61 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX5E-0005JP-VF for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:34 -0500 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]:44709) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX5E-0005J5-RL; Mon, 06 Jan 2020 13:26:32 -0500 Received: by mail-qv1-xf42.google.com with SMTP id n8so19408495qvg.11; Mon, 06 Jan 2020 10:26:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8epzYC9Hx96nC8wKq8nl8igdorRt4UtCgIwD3AuQIS8=; b=CtGRoI1EAaFcZ6XoR5d+63MLor+iAEqD2yM88p5EaGJXkcPA9LKw3LiViNE5nDNejI ABgUNaD6xhvfr1VYxHN+POKVOR40TVf6QUGvzZCiZJ4xztny9YCi67AyIYgo7pwPwIAD CuR/1wIM0q/H/1p+His7K4QoYglHO7cKAJ/HF825HXbChXuByO/OC0ztG4npOytSl2HF v7HYadn8fhnmUYifDQ/GAt34Ec23R0aX5h8BGPziaU5JTrsj+BA/wHwo2MdQoXOY9XZB 2QTp4yefkn51kwf1LkTr+jQRQpiVaAAG2kwg7t4sunaCf32ZidCRVOtFa8JWk4UOVwAH EXUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8epzYC9Hx96nC8wKq8nl8igdorRt4UtCgIwD3AuQIS8=; b=cCbz6RrrVbDa6dhTQqfhupqKQfjuF8DFpFjR6+TTDPHm79UkW+KDBz8cTGoO8Yafz4 +r62rNH3S7CURSLC2dzIJRuDf5QsHnmG/5+DQ/B5+PYr5hyRZvxMll4gi1AKjgjGYuHU gTlAqf6iSOo/TcW9Hd7tf75mTcRlww98ncv6B58eYBqYGZZXDeXBxJQTNFXVRlar3897 s5mWmWfaGw4Vh76SPNgSzO52IZ0Pgfr3A5cgjKo4jlaT/j9CFuAytXv3Gd1S1XsmdhZm GvGYVP/V9qKMRZbWe0t3NEMJcO2LpeJ0VdDLvsnFVLvsiBbZZJO16vlIBzMUGGBLTQaR PGqA== X-Gm-Message-State: APjAAAWJop3wiGWg/ajholh2qo/0bKT2kQGGssS+wtq5VKrkWSQXOjKH fvM18vpjjLhKxGIrciBvJsSC0jjI X-Google-Smtp-Source: APXvYqxtyRMbmiEujs6q/5zgBBL/E9J99OUADg6ZgH+EC79ejwTz2kcu9nJQQyNjSHyiW7bCWWSW7Q== X-Received: by 2002:a0c:a145:: with SMTP id d63mr82830123qva.120.1578335192274; Mon, 06 Jan 2020 10:26:32 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:31 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 56/59] linux-user/signal.c: remove unneeded label in do_sigaltstack() Date: Mon, 6 Jan 2020 15:24:22 -0300 Message-Id: <20200106182425.20312-57-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f42 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Riku Voipio , Daniel Henrique Barboza , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' can be replaced by 'return ret'. Since 'ret' is used just to set the return value, drop the 'ret' variable and use 'return' with the appropriate value instead. CC: Riku Voipio CC: Laurent Vivier Signed-off-by: Daniel Henrique Barboza --- linux-user/signal.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 5ca6d62b15..5efb1b79d9 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -708,7 +708,6 @@ static void host_signal_handler(int host_signum, siginfo_t *info, /* compare linux/kernel/signal.c:do_sigaltstack() */ abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp) { - int ret; struct target_sigaltstack oss; TaskState *ts = (TaskState *)thread_cpu->opaque; @@ -734,32 +733,28 @@ abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp) } #endif - ret = -TARGET_EFAULT; if (!lock_user_struct(VERIFY_READ, uss, uss_addr, 1)) { - goto out; + return -TARGET_EFAULT; } __get_user(ss.ss_sp, &uss->ss_sp); __get_user(ss.ss_size, &uss->ss_size); __get_user(ss.ss_flags, &uss->ss_flags); unlock_user_struct(uss, uss_addr, 0); - ret = -TARGET_EPERM; if (on_sig_stack(sp)) - goto out; + return -TARGET_EPERM; - ret = -TARGET_EINVAL; if (ss.ss_flags != TARGET_SS_DISABLE && ss.ss_flags != TARGET_SS_ONSTACK && ss.ss_flags != 0) - goto out; + return -TARGET_EINVAL; if (ss.ss_flags == TARGET_SS_DISABLE) { ss.ss_size = 0; ss.ss_sp = 0; } else { - ret = -TARGET_ENOMEM; if (ss.ss_size < minstacksize) { - goto out; + return -TARGET_ENOMEM; } } @@ -768,14 +763,11 @@ abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp) } if (uoss_addr) { - ret = -TARGET_EFAULT; if (copy_to_user(uoss_addr, &oss, sizeof(oss))) - goto out; + return -TARGET_EFAULT; } - ret = 0; -out: - return ret; + return 0; } /* do_sigaction() return target values and host errnos */ From patchwork Mon Jan 6 18:24:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218425 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rD8S9lV9"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s50X3P6xz9sQp for ; Tue, 7 Jan 2020 06:19:06 +1100 (AEDT) Received: from localhost ([::1]:58730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXu3-0006jh-Cw for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:19:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46588) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX5I-00046M-OP for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX5H-0005Lu-7E for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:36 -0500 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:39837) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX5H-0005LQ-3H; Mon, 06 Jan 2020 13:26:35 -0500 Received: by mail-qt1-x843.google.com with SMTP id e5so43200842qtm.6; Mon, 06 Jan 2020 10:26:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ccbDbqi5TpxjVO4gg8wa3OUyCmF9mr26PCOhgdDhY5Q=; b=rD8S9lV90nJR1aQdNOkFzLUnqDwG0zLCFCjl6ZJP1ejSDzVvYdE0laaNUwz9upVf5/ g340pbGs05UsOrcLPF0FJ8TfXFK7TLju2U+OXUemAG0sIoZEVMKEAFlL3zS2nOLTt5+O 0lQP7e+aTwhdpiUtNH+BjMwHwOT7AXRjphGTXOMCSKybRcnRdGv1064D1bUAKv41On8V URfWk4TbXSnjt+cH3poNEuMte6v1Tlf5bWj90f0qf+ZUVI7Ve46eRs1WzRGWEv9CR51A Ht8Y7M8NP1HBw42yX9/5iaFU+yHtowpqzU9yULWxVsQbIwV2hOzCn2sRXmzKeQe33CL9 nZhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ccbDbqi5TpxjVO4gg8wa3OUyCmF9mr26PCOhgdDhY5Q=; b=uYPCNre+wEdUVBh2To9LgHebPN8QQnJEFEtzgkldDOiX8NbG29CAtVGelkU7sLodUd r7xmTehMQzX5CfzrLDgCQMNSiNv24kZ5BMqFzK/4fKQhEWPFn+dHTPoGKh6v12cvvhKo o6NOCH0ef+3E7CFWLl1Kr4zrTBHmParHMd1nCRJH94kN27986kpzS9o1u0HQPKOaN+Ly dsBw3L3CbCkWcJMbVboCQ6n+PG/WKU9XGjABpKdS1V1w+9Su2pZeOvAIdw1npT6jzThH sRMAHIhW6lev1vDgm/pZ5FaIMEPFifSJobpkAAYcwYgwVkeHWWCpwvZeOwjobWxEMaNp IOMw== X-Gm-Message-State: APjAAAXpAMtYQVDtBDSpJTY1e/l3dZoudnpBi2H0i4IARQ1HNJ1MEK4r UkrVWw6ZtJKR2GSUz4VdNrnhGHGZ X-Google-Smtp-Source: APXvYqwxkipLwpEZ9rRAif+gDyZa4pKepNu5OkiSHk08Vsc1pqvhLLpe3mv8sCxBN8LfE8Q79xkxHg== X-Received: by 2002:ac8:5215:: with SMTP id r21mr75442967qtn.77.1578335194548; Mon, 06 Jan 2020 10:26:34 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:34 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 57/59] linux-user/syscall.c: fix trailing whitespaces and style Date: Mon, 6 Jan 2020 15:24:23 -0300 Message-Id: <20200106182425.20312-58-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::843 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Riku Voipio , Daniel Henrique Barboza , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" There are trailing whitespaces in this file that, if removed by a text editor that refuses to let the traiing whitespace alone, which happens to be the editor I am using, will cause checkpatch.pl to warn about styling problems in the resulting patch. This happens because the trailing whitespace lines are using a deprecated style. To keep the intended change I wanted to do (remove unneeded labels in do_ioctl_blkpg() and do_sendrecvmsg_locked()) trivial, this patch is another trivial change to fix the trailing whitespaces and the code style errors that checkpatch.pl warns about. Doing this change beforehand will keep the next patch focused just on the label removal changes. CC: Riku Voipio CC: Laurent Vivier Signed-off-by: Daniel Henrique Barboza Reviewed-by: Peter Maydell --- linux-user/syscall.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 171c0caef3..49c6151c2d 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -1062,7 +1062,7 @@ static inline rlim_t target_to_host_rlim(abi_ulong target_rlim) { abi_ulong target_rlim_swap; rlim_t result; - + target_rlim_swap = tswapal(target_rlim); if (target_rlim_swap == TARGET_RLIM_INFINITY) return RLIM_INFINITY; @@ -1070,7 +1070,7 @@ static inline rlim_t target_to_host_rlim(abi_ulong target_rlim) result = target_rlim_swap; if (target_rlim_swap != (rlim_t)result) return RLIM_INFINITY; - + return result; } @@ -1078,13 +1078,13 @@ static inline abi_ulong host_to_target_rlim(rlim_t rlim) { abi_ulong target_rlim_swap; abi_ulong result; - + if (rlim == RLIM_INFINITY || rlim != (abi_long)rlim) target_rlim_swap = TARGET_RLIM_INFINITY; else target_rlim_swap = rlim; result = tswapal(target_rlim_swap); - + return result; } @@ -1526,10 +1526,11 @@ static inline abi_long target_to_host_cmsg(struct msghdr *msgh, abi_ulong target_cmsg_addr; struct target_cmsghdr *target_cmsg, *target_cmsg_start; socklen_t space = 0; - + msg_controllen = tswapal(target_msgh->msg_controllen); - if (msg_controllen < sizeof (struct target_cmsghdr)) + if (msg_controllen < sizeof(struct target_cmsghdr)) { goto the_end; + } target_cmsg_addr = tswapal(target_msgh->msg_control); target_cmsg = lock_user(VERIFY_READ, target_cmsg_addr, msg_controllen, 1); target_cmsg_start = target_cmsg; @@ -1610,8 +1611,9 @@ static inline abi_long host_to_target_cmsg(struct target_msghdr *target_msgh, socklen_t space = 0; msg_controllen = tswapal(target_msgh->msg_controllen); - if (msg_controllen < sizeof (struct target_cmsghdr)) + if (msg_controllen < sizeof(struct target_cmsghdr)) { goto the_end; + } target_cmsg_addr = tswapal(target_msgh->msg_control); target_cmsg = lock_user(VERIFY_WRITE, target_cmsg_addr, msg_controllen, 0); target_cmsg_start = target_cmsg; @@ -5592,9 +5594,9 @@ abi_long do_set_thread_area(CPUX86State *env, abi_ulong ptr) } unlock_user_struct(target_ldt_info, ptr, 1); - if (ldt_info.entry_number < TARGET_GDT_ENTRY_TLS_MIN || + if (ldt_info.entry_number < TARGET_GDT_ENTRY_TLS_MIN || ldt_info.entry_number > TARGET_GDT_ENTRY_TLS_MAX) - return -TARGET_EINVAL; + return -TARGET_EINVAL; seg_32bit = ldt_info.flags & 1; contents = (ldt_info.flags >> 1) & 3; read_exec_only = (ldt_info.flags >> 3) & 1; @@ -5670,7 +5672,7 @@ static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr) lp = (uint32_t *)(gdt_table + idx); entry_1 = tswap32(lp[0]); entry_2 = tswap32(lp[1]); - + read_exec_only = ((entry_2 >> 9) & 1) ^ 1; contents = (entry_2 >> 10) & 3; seg_not_present = ((entry_2 >> 15) & 1) ^ 1; @@ -5686,8 +5688,8 @@ static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr) (read_exec_only << 3) | (limit_in_pages << 4) | (seg_not_present << 5) | (useable << 6) | (lm << 7); limit = (entry_1 & 0xffff) | (entry_2 & 0xf0000); - base_addr = (entry_1 >> 16) | - (entry_2 & 0xff000000) | + base_addr = (entry_1 >> 16) | + (entry_2 & 0xff000000) | ((entry_2 & 0xff) << 16); target_ldt_info->base_addr = tswapal(base_addr); target_ldt_info->limit = tswap32(limit); @@ -10554,8 +10556,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, return get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3))); #if defined(TARGET_NR_fchownat) case TARGET_NR_fchownat: - if (!(p = lock_user_string(arg2))) + p = lock_user_string(arg2); + if (!p) { return -TARGET_EFAULT; + } ret = get_errno(fchownat(arg1, p, low2highuid(arg3), low2highgid(arg4), arg5)); unlock_user(p, arg2, 0); From patchwork Mon Jan 6 18:24:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rxgaaiaG"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s4hM2flwz9sPn for ; Tue, 7 Jan 2020 06:05:07 +1100 (AEDT) Received: from localhost ([::1]:58310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXgW-0002F6-Hn for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:05:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46608) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX5K-00048o-9p for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX5J-0005NT-0f for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:38 -0500 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:33737) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX5I-0005ND-TK; Mon, 06 Jan 2020 13:26:36 -0500 Received: by mail-qt1-x841.google.com with SMTP id d5so43225469qto.0; Mon, 06 Jan 2020 10:26:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XLjlJHRdZ19eNFwu3xtUWDKA1dixiH7lhcQ1c7qm+lk=; b=rxgaaiaGGAXY4b6eaHrizaVp6uRoDPzxm0U99pvv3OC2vBkxMyVPG1nC3ijsI2Xeiu Io8w5WoSUPCizvSw3Sjyz0yfIZEp9HGSV+PbEBxooaWvy264gz4Ijm3NpxPMMPZin937 0iuI4IW00jfInthvUMN1kPBSZbQEWy3l8JL3I87w6KuqnCbX5V0wV8Iliqa5n4jI+ewh 3uki8cLhCINIkX0ml3n6wGlT2zkRxfCCdlGlsVyUa1UbSeQ559yHXsZh/WK5bv2cH5w2 uk6FPikyAAHpY0NxBpSjTC/BxG+q7XOug+eBodSz16DcveCs8//r+mDJnLHs5X/t+Rff uj3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XLjlJHRdZ19eNFwu3xtUWDKA1dixiH7lhcQ1c7qm+lk=; b=h0Wdu4AMAZ9i1Al8pg4+lE1Wf9n7a2LbFkCqcj9IBnFqgSkd2FCQBtN7UewMMIiTvB Acq4b+zOBOi6PkwjCmGGDwNfTrvLvCKp0PmSKmJNadgyM09pUYPRcCLNpocQuSxLPiHu wbBiSfGUWTTk9RyPUpMkx2yVMw+Gpu6DuWkeV2Ho5CF7PYkzCkJT3TJf1Me877csnsuF K5rU8yIlnUm52LVhKGOtVRn6MkHheyGjAaNkzh2mtv9GoFn4+pfujV2Qy7y7Km1YKFDE 0tmXpx5Hs3AEXFVVQvZRfEA73VhZxrzzZ1sADHmImTTq5teftV30PBTlBNRgucAp0bmt +15g== X-Gm-Message-State: APjAAAWKnQj+wzP5FEraDVG01drIAWBobEOgJFJmbQwHDKFS0n5nRVue sXGA8np8ZN/vtHlluzA7L/+ewfCo X-Google-Smtp-Source: APXvYqwqRExlnWSj4gM1GN00iSoFDDf0O6JVyrbbvKFfmIWOynI3GK8nhm+eTh7R+pmsda/kpSdNhA== X-Received: by 2002:ac8:5442:: with SMTP id d2mr78989156qtq.297.1578335196334; Mon, 06 Jan 2020 10:26:36 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:35 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 58/59] linux-user/syscall.c: remove unneeded labels Date: Mon, 6 Jan 2020 15:24:24 -0300 Message-Id: <20200106182425.20312-59-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::841 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Riku Voipio , Daniel Henrique Barboza , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out2' label in do_sendrecvmsg_locked() can be replaced by 'return' with the adequate exit value. Same thing with the label 'out' in do_ioctl_blkpg(), and in that function we can get rid of the 'ret' variable as well. CC: Riku Voipio CC: Laurent Vivier Signed-off-by: Daniel Henrique Barboza --- linux-user/syscall.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 49c6151c2d..5db066921e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2941,7 +2941,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp, */ msg.msg_name = (void *)-1; } else if (ret) { - goto out2; + return ret; } } else { msg.msg_name = NULL; @@ -2960,15 +2960,13 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp, /* sendrcvmsg returns a different errno for this condition than * readv/writev, so we must catch it here before lock_iovec() does. */ - ret = -TARGET_EMSGSIZE; - goto out2; + return -TARGET_EMSGSIZE; } vec = lock_iovec(send ? VERIFY_READ : VERIFY_WRITE, target_vec, count, send); if (vec == NULL) { - ret = -host_to_target_errno(errno); - goto out2; + return -host_to_target_errno(errno); } msg.msg_iovlen = count; msg.msg_iov = vec; @@ -3020,7 +3018,6 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp, out: unlock_iovec(vec, target_vec, count, !send); -out2: return ret; } @@ -4952,7 +4949,6 @@ static abi_long do_ioctl_blkpg(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, int target_size; const argtype *arg_type = ie->arg_type; const argtype part_arg_type[] = { MK_STRUCT(STRUCT_blkpg_partition) }; - abi_long ret; struct blkpg_ioctl_arg *host_blkpg = (void*)buf_temp; struct blkpg_partition host_part; @@ -4962,8 +4958,7 @@ static abi_long do_ioctl_blkpg(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, target_size = thunk_type_size(arg_type, 0); argptr = lock_user(VERIFY_READ, arg, target_size, 1); if (!argptr) { - ret = -TARGET_EFAULT; - goto out; + return -TARGET_EFAULT; } thunk_convert(buf_temp, argptr, arg_type, THUNK_HOST); unlock_user(argptr, arg, 0); @@ -4975,8 +4970,7 @@ static abi_long do_ioctl_blkpg(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, break; default: /* Unknown opcode */ - ret = -TARGET_EINVAL; - goto out; + return -TARGET_EINVAL; } /* Read and convert blkpg->data */ @@ -4984,18 +4978,14 @@ static abi_long do_ioctl_blkpg(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, target_size = thunk_type_size(part_arg_type, 0); argptr = lock_user(VERIFY_READ, arg, target_size, 1); if (!argptr) { - ret = -TARGET_EFAULT; - goto out; + return -TARGET_EFAULT; } thunk_convert(&host_part, argptr, part_arg_type, THUNK_HOST); unlock_user(argptr, arg, 0); /* Swizzle the data pointer to our local copy and call! */ host_blkpg->data = &host_part; - ret = get_errno(safe_ioctl(fd, ie->host_cmd, host_blkpg)); - -out: - return ret; + return get_errno(safe_ioctl(fd, ie->host_cmd, host_blkpg)); } static abi_long do_ioctl_rt(const IOCTLEntry *ie, uint8_t *buf_temp, From patchwork Mon Jan 6 18:24:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Henrique Barboza X-Patchwork-Id: 1218430 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YRHtec+6"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47s51j4l59z9sR4 for ; Tue, 7 Jan 2020 06:20:09 +1100 (AEDT) Received: from localhost ([::1]:58762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioXv5-0008Bv-IF for incoming@patchwork.ozlabs.org; Mon, 06 Jan 2020 14:20:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46630) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioX5L-0004Ba-Vj for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioX5K-0005PS-TU for qemu-devel@nongnu.org; Mon, 06 Jan 2020 13:26:39 -0500 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:39836) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioX5K-0005P0-Q6; Mon, 06 Jan 2020 13:26:38 -0500 Received: by mail-qt1-x841.google.com with SMTP id e5so43200983qtm.6; Mon, 06 Jan 2020 10:26:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q32rULKz3P9b6ke9olYLbvQa+p3xcZiLFsA6TSHCyN8=; b=YRHtec+6gQkyO8Q1QEPd+ZjMIctJswB2JVqUKy8ZpBSNA2A80anJziRw2RNP6+WROM QoROU0jmDp6ku7XfIg4pD24HFj9sLo6VSl0VrbSeD/Ap+frv60bejoO+C+Yu98UA2a+A 8F8h6zufzf2ph6hPTGZ4EH4Cp3YLfAAiG7TmcC5d94390LAJGdE9cNNSbWrcYZfLATn8 GzYExcQiXRUYClOHv3++nN0olVDFFY5nLy9B10rAneTb7n6Ytk7VRh1h8fJuT53epP0h /VNWudnyyBB16c/NxH3CO9RPOS3FosOtYxYOgNgn+p1J3W660+XHG8tTArQTZkbL2EB+ r38Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q32rULKz3P9b6ke9olYLbvQa+p3xcZiLFsA6TSHCyN8=; b=ukzEkCPUychoIhgZ+ngzJU14ut4+LJdur7dq10g8gUvIAat1gN+sSSnIDB4/uGTeFs z+49UShWXY4UAlhat4S6fSz74/8INrpT2aPlefp2R/GE+uUbMFtxZqO4bjs4Pxi7K/b6 LQrQb7ELPAnpc9m2gNA8b8jUIsdPlN3f0f6fz8q+7hTMo3JolqrJHeCSryfxcY7SZ1Op hlqh8O+Urm1QfwoZ7E116YoOEdP0ePWKdIShYj++qXkS3bfdE3wDl2eDP0XbLFF38Ywj YH5QKeNxd1zvWtdARrQPZQczoiLiQUl2sT6m4seq46k2vxzPYWPRoZzt4sNJFYVU9UB2 3jHA== X-Gm-Message-State: APjAAAX5IfIlfTzzAFr6gI+ArmRplGlnBeDTF/RsgU06DxtJkDpq833M +M/faBGe2KgAEwYDrplDJVaGe/aP X-Google-Smtp-Source: APXvYqxKlqxxWT1ZxGM41mk+ro9IEI89tdH9hwlP2posSHuazzXVALsjzFSUx8ZfFjAvmwaqbLc5Aw== X-Received: by 2002:ac8:534b:: with SMTP id d11mr76351116qto.170.1578335198304; Mon, 06 Jan 2020 10:26:38 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c6:655b:9e1c:e865:3705:e1df]) by smtp.gmail.com with ESMTPSA id b81sm21026522qkc.135.2020.01.06.10.26.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 10:26:38 -0800 (PST) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Subject: [PATCH v1 59/59] linux-user/vm86.c: remove unneeded label in do_vm86() Date: Mon, 6 Jan 2020 15:24:25 -0300 Message-Id: <20200106182425.20312-60-danielhb413@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200106182425.20312-1-danielhb413@gmail.com> References: <20200106182425.20312-1-danielhb413@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::841 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Riku Voipio , Daniel Henrique Barboza , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 'out' can be replaced by 'return' calls with the adequate return value. CC: Riku Voipio CC: Laurent Vivier Signed-off-by: Daniel Henrique Barboza --- linux-user/vm86.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/linux-user/vm86.c b/linux-user/vm86.c index 2fa7a89edc..eceddd05df 100644 --- a/linux-user/vm86.c +++ b/linux-user/vm86.c @@ -403,16 +403,14 @@ int do_vm86(CPUX86State *env, long subfunction, abi_ulong vm86_addr) case TARGET_VM86_GET_IRQ_BITS: case TARGET_VM86_GET_AND_RESET_IRQ: gemu_log("qemu: unsupported vm86 subfunction (%ld)\n", subfunction); - ret = -TARGET_EINVAL; - goto out; + return -TARGET_EINVAL; case TARGET_VM86_PLUS_INSTALL_CHECK: /* NOTE: on old vm86 stuff this will return the error from verify_area(), because the subfunction is interpreted as (invalid) address to vm86_struct. So the installation check works. */ - ret = 0; - goto out; + return 0; } /* save current CPU regs */ @@ -485,6 +483,5 @@ int do_vm86(CPUX86State *env, long subfunction, abi_ulong vm86_addr) LOG_VM86("do_vm86: cs:ip=%04x:%04x\n", env->segs[R_CS].selector, env->eip); /* now the virtual CPU is ready for vm86 execution ! */ - out: return ret; }