From nobody Sun Feb 8 17:46:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1588673477; cv=none; d=zohomail.com; s=zohoarc; b=fvdKUTHaUyvTiX9HFm6NGPC+Y9c9EHh0R9+WKaRa4Q1aLC/F9wSVnDL1drKgPGe3qpu5FPyFfokCag+7lVi1pJJuHeX875eo6m18bksnsV6za8iejoUtY9puCv7veWYIBu6vQ3nHFb32bs12wnns+KmTRgkk8hx4UBaKChrw7jg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588673477; h=Content-Type:Content-Transfer-Encoding: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=2iZoI9reXhU18qqvkCOwelRQ6uCD4+g7iCZ6l89xsa4=; b=SC3sLoGrMqJyz6Ib24Pjke3DbmWzevrPG4c4ZBikyYYAHTRAzaHokS9Uh+065xnTs8GbSnUgcJ8uTpbhaqXhUciQZOEQtm35a1ydd6TdXKT9UatO4k3uYXjYFmcvvxnb3KvopHxU0jYuSgOTq2dvm+9YDZcSchxlKAj0phXK3lc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1588673477141639.0735442254697; Tue, 5 May 2020 03:11:17 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-239-0pVjTBhyMgaILclbeFeDfQ-1; Tue, 05 May 2020 06:11:11 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 56D43100A8FB; Tue, 5 May 2020 10:11:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2AEA05D9D5; Tue, 5 May 2020 10:11:04 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CD4711809563; Tue, 5 May 2020 10:11:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 045AAL0x001485 for ; Tue, 5 May 2020 06:10:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3EA7A1057FCB; Tue, 5 May 2020 10:10:21 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADE7C10246E7 for ; Tue, 5 May 2020 10:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588673475; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=2iZoI9reXhU18qqvkCOwelRQ6uCD4+g7iCZ6l89xsa4=; b=PTUckLgdHVzxhnDTWg5AJBQFhIMu5bovsvtUxzRJxkO/ET6bw1zSGE1czi2l+xHUvPyLXF CXcYacBshVK9477hhj9DgIu0/Xie1OItbzmvjuEj40VEmeRMYxex7BePGrucf5c08kDNoF hHXef+rdSMfpZHVMIHYv/2SanzCLL2E= X-MC-Unique: 0pVjTBhyMgaILclbeFeDfQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/4] lib: Drop needless ret variables Date: Tue, 5 May 2020 12:10:07 +0200 Message-Id: <0b8513901a1ff97a2b9b6cd9d1c217e4c1cdcdb2.1588672891.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There are few places where a return variable is introduced (ret or retval), but then is never changed and is then passed to return. Well, we can return the value that the variable is initialized to directly. Signed-off-by: Michal Privoznik --- src/locking/lock_daemon.c | 3 +-- src/logging/log_daemon.c | 3 +-- src/storage/storage_backend_mpath.c | 3 +-- tools/virt-host-validate-bhyve.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index 4eff63014a..b0cd89375b 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -720,7 +720,6 @@ virLockDaemonPreExecRestart(const char *state_file, { virJSONValuePtr child; char *state =3D NULL; - int ret =3D -1; virJSONValuePtr object =3D virJSONValueNewObject(); char *magic; virHashKeyValuePairPtr pairs =3D NULL, tmp; @@ -800,7 +799,7 @@ virLockDaemonPreExecRestart(const char *state_file, VIR_FREE(pairs); VIR_FREE(state); virJSONValueFree(object); - return ret; + return -1; } =20 =20 diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index f37054706e..7017db2dcc 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -524,7 +524,6 @@ virLogDaemonPreExecRestart(const char *state_file, { virJSONValuePtr child; char *state =3D NULL; - int ret =3D -1; virJSONValuePtr object =3D virJSONValueNewObject(); char *magic; virHashKeyValuePairPtr pairs =3D NULL; @@ -581,7 +580,7 @@ virLogDaemonPreExecRestart(const char *state_file, VIR_FREE(pairs); VIR_FREE(state); virJSONValueFree(object); - return ret; + return -1; } =20 =20 diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_back= end_mpath.c index 7cb084b2d6..fffc0f86b7 100644 --- a/src/storage/storage_backend_mpath.c +++ b/src/storage/storage_backend_mpath.c @@ -243,7 +243,6 @@ virStorageBackendMpathCheckPool(virStoragePoolObjPtr po= ol G_GNUC_UNUSED, static int virStorageBackendMpathRefreshPool(virStoragePoolObjPtr pool) { - int retval =3D 0; virStoragePoolDefPtr def =3D virStoragePoolObjGetDef(pool); =20 VIR_DEBUG("pool=3D%p", pool); @@ -254,7 +253,7 @@ virStorageBackendMpathRefreshPool(virStoragePoolObjPtr = pool) =20 virStorageBackendGetMaps(pool); =20 - return retval; + return 0; } =20 =20 diff --git a/tools/virt-host-validate-bhyve.c b/tools/virt-host-validate-bh= yve.c index 2f0ec1e36c..3e8cc59a38 100644 --- a/tools/virt-host-validate-bhyve.c +++ b/tools/virt-host-validate-bhyve.c @@ -47,7 +47,6 @@ =20 int virHostValidateBhyve(void) { - int ret =3D 0; int fileid =3D 0; struct kld_file_stat stat; bool vmm_loaded =3D false, if_tap_loaded =3D false; @@ -73,5 +72,5 @@ int virHostValidateBhyve(void) MODULE_STATUS_WARN(if_bridge, "bridged networking will not work"); MODULE_STATUS_WARN(nmdm, "nmdm console will not work"); =20 - return ret; + return 0; } --=20 2.26.2