From nobody Sun Feb 8 18:29:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1570811140; cv=none; d=zoho.com; s=zohoarc; b=AdVGcXcHJGDRq12ACkqOPKIHfdHefzX7dVFUBAW4runTwY19DwdQKXKE6HpJ5rgvPjxTXFmVig5Hr/ndhLVzanpS5SK+dIUS+usfGtXHP7q/HGbhIGH6legUtWqWJ0nYUBFiG2cXEZhLTFxw2uzkVsXyMAF8NzMwWV46Aj1UfpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570811140; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=503Ljiv3Jd4peKUTi2DX1VQm95b4WJcWsdjIoahmhAs=; b=C4zwVlrlGTpB8DTeXMAe/E65ovxWBAvCmKQdu83PHVSwv0+DrdQP09VKTaT+WodcPu2rsVD84B4CwUUXCLFpBfJxcc1LyinR+rplo2MtgA/1ir30B73MgVM4nbMV/T/MvwVJ3wbR965fJrvJwN6f9VOG3NnQhOxlevckUq3HLo8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1570811140063442.26740791622547; Fri, 11 Oct 2019 09:25:40 -0700 (PDT) Received: from localhost ([::1]:53772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIxjW-0003Os-6V for importer@patchew.org; Fri, 11 Oct 2019 12:25:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35910) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iIxQW-0005ZB-Fj for qemu-devel@nongnu.org; Fri, 11 Oct 2019 12:06:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iIxQV-00041W-Bd for qemu-devel@nongnu.org; Fri, 11 Oct 2019 12:06:00 -0400 Received: from relay.sw.ru ([185.231.240.75]:47796) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iIxQV-00040O-3D for qemu-devel@nongnu.org; Fri, 11 Oct 2019 12:05:59 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iIxQT-0003XG-Lr; Fri, 11 Oct 2019 19:05:57 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [RFC v5 005/126] vnc: drop Error pointer indirection in vnc_client_io_error Date: Fri, 11 Oct 2019 19:03:51 +0300 Message-Id: <20191011160552.22907-6-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20191011160552.22907-1-vsementsov@virtuozzo.com> References: <20191011160552.22907-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 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: vsementsov@virtuozzo.com, armbru@redhat.com, Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We don't need Error **, as all callers pass local Error object, which isn't used after the call, or NULL. Use Error * instead. Signed-off-by: Vladimir Sementsov-Ogievskiy --- ui/vnc.h | 2 +- ui/vnc.c | 20 +++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/ui/vnc.h b/ui/vnc.h index fea79c2fc9..4e2637ce6c 100644 --- a/ui/vnc.h +++ b/ui/vnc.h @@ -547,7 +547,7 @@ uint32_t read_u32(uint8_t *data, size_t offset); =20 /* Protocol stage functions */ void vnc_client_error(VncState *vs); -size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp); +size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error *err); =20 void start_client_init(VncState *vs); void start_auth_vnc(VncState *vs); diff --git a/ui/vnc.c b/ui/vnc.c index 87b8045afe..4100d6e404 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1312,7 +1312,7 @@ void vnc_disconnect_finish(VncState *vs) g_free(vs); } =20 -size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp) +size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error *err) { if (ret <=3D 0) { if (ret =3D=3D 0) { @@ -1320,15 +1320,11 @@ size_t vnc_client_io_error(VncState *vs, ssize_t re= t, Error **errp) vnc_disconnect_start(vs); } else if (ret !=3D QIO_CHANNEL_ERR_BLOCK) { trace_vnc_client_io_error(vs, vs->ioc, - errp ? error_get_pretty(*errp) : - "Unknown"); + err ? error_get_pretty(err) : "Unkno= wn"); vnc_disconnect_start(vs); } =20 - if (errp) { - error_free(*errp); - *errp =3D NULL; - } + error_free(err); return 0; } return ret; @@ -1361,10 +1357,9 @@ size_t vnc_client_write_buf(VncState *vs, const uint= 8_t *data, size_t datalen) { Error *err =3D NULL; ssize_t ret; - ret =3D qio_channel_write( - vs->ioc, (const char *)data, datalen, &err); + ret =3D qio_channel_write(vs->ioc, (const char *)data, datalen, &err); VNC_DEBUG("Wrote wire %p %zd -> %ld\n", data, datalen, ret); - return vnc_client_io_error(vs, ret, &err); + return vnc_client_io_error(vs, ret, err); } =20 =20 @@ -1488,10 +1483,9 @@ size_t vnc_client_read_buf(VncState *vs, uint8_t *da= ta, size_t datalen) { ssize_t ret; Error *err =3D NULL; - ret =3D qio_channel_read( - vs->ioc, (char *)data, datalen, &err); + ret =3D qio_channel_read(vs->ioc, (char *)data, datalen, &err); VNC_DEBUG("Read wire %p %zd -> %ld\n", data, datalen, ret); - return vnc_client_io_error(vs, ret, &err); + return vnc_client_io_error(vs, ret, err); } =20 =20 --=20 2.21.0