From nobody Sun Feb 8 18:44:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1602098591; cv=none; d=zohomail.com; s=zohoarc; b=QNlOo4wQG9xwyrV0zT9+GQ1o7vMQ3JgkwbNT8xdPSIjWJ3o5J54bzHzy8n3nQAJbTJealMcCNwx61XPxX0M0/kYI4tB1A1vvWbvD9XDTOc06LyX+KRMsQ7JkJPrBvQUXpe/ltvT4yqsHjMKynS/OIjxSGiYNDFhbTeV9RKWAw6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602098591; 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=GeLARcztHSNxtsjH8EtqVZx+iCUvX96IwIqQhf7YJtU=; b=msQsEejeNDkxD8W2TgkXU4gumv6I/lxnI7uGF7DKGuCeER55qKONG6xTD01GEO6T62HvBZrtEodi/WC+7UqQd+g/hmayrm1immuGXbr2jm8XjaX+aRssS09nKmFJvkWfM0X9NNtT73Hk5u+0UpABeP9cmMM+C25BJ84xapTNWGU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1602098591213822.8708838518219; Wed, 7 Oct 2020 12:23:11 -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-459-jnd7HG_UPyCAFx7PvetDCA-1; Wed, 07 Oct 2020 15:23:06 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 096CE18A8230; Wed, 7 Oct 2020 19:23:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DBF8165F5E; Wed, 7 Oct 2020 19:23:00 +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 A85858C7BD; Wed, 7 Oct 2020 19:23:00 +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 097JMiwk006011 for ; Wed, 7 Oct 2020 15:22:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id C7F5C1001281; Wed, 7 Oct 2020 19:22:44 +0000 (UTC) Received: from hjs.redhat.com (unknown [10.43.2.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50353100239A for ; Wed, 7 Oct 2020 19:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602098590; 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=GeLARcztHSNxtsjH8EtqVZx+iCUvX96IwIqQhf7YJtU=; b=E8x3ImWapftZQzFLwuL5pBaHylJBF4dvJfjqcd4nOjH4L5P/sYvyNz0uVBNAZNPuC5DRPD hn3/dRbwkx+g4MmPOTw4bT8G4KCV2N7NXXQ4SX7M8bhJew0HhwfXyp3+qOr5llJz5FfUQ5 NlRp83nLwD03SrzPmK3jMeM7MnSbl7A= X-MC-Unique: jnd7HG_UPyCAFx7PvetDCA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 13/13] conf: virDomainUSBAddressHubNew: refactor Date: Wed, 7 Oct 2020 21:22:29 +0200 Message-Id: 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.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Remove the pointless variable and pointer stealing. Signed-off-by: J=C3=A1n Tomko --- src/conf/domain_addr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index ab508b0c8f..03d0c6825d 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -2029,7 +2029,7 @@ virDomainUSBAddressControllerModelToPorts(virDomainCo= ntrollerDefPtr cont) static virDomainUSBAddressHubPtr virDomainUSBAddressHubNew(size_t nports) { - virDomainUSBAddressHubPtr hub =3D NULL, ret =3D NULL; + virDomainUSBAddressHubPtr hub; =20 hub =3D g_new0(virDomainUSBAddressHub, 1); =20 @@ -2038,9 +2038,7 @@ virDomainUSBAddressHubNew(size_t nports) hub->ports =3D g_new0(virDomainUSBAddressHubPtr, nports); hub->nports =3D nports; =20 - ret =3D g_steal_pointer(&hub); - virDomainUSBAddressHubFree(hub); - return ret; + return hub; } =20 =20 --=20 2.26.2