From nobody Sun Feb 8 18:10:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1571752747; cv=none; d=zoho.com; s=zohoarc; b=ors8O/Yy8AhdMCVXQS1eF6HXtM+deKzInxLNpd4jOorMbm9ErIHrM7H1TVHbCy/Sw31niV3FWC+6OD33299JikLFSV4ZrN358HgmF7TPhpNLw3g3DQt//owV1LsgEwhMdl9xlcLfDlw0dnd0JGvr2zBayq+kUQS7BkJd8ZmDo7A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571752747; 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=3gag8RaptN81qH4+5MGFfGL3sDgh1jY8kVIok3pKMs4=; b=AxktsicYgoYuzW9+uYkqIy29hROaBPx4JcuvnE9PK1ghSyc3B9uCWT+BysVIVzE3LodzIiqO96WklS17GCWWtxZwCjaM49XquM74RfjP1GjGxocTb8975WnszOC4sFOhxVR4XGLE09bQOYL4drhSaFqDbJ10bEikDVjp2TcXfFU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.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-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1571752747497611.0553148685071; Tue, 22 Oct 2019 06:59:07 -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-129-CFY46QWIN0KFb0z-Prh2mQ-1; Tue, 22 Oct 2019 09:59:03 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C3DB801E77; Tue, 22 Oct 2019 13:58:57 +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 29A626012C; Tue, 22 Oct 2019 13:58:57 +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 DF5BF180BAA7; Tue, 22 Oct 2019 13:58:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9MDwgIU001663 for ; Tue, 22 Oct 2019 09:58:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 011C06012C; Tue, 22 Oct 2019 13:58:42 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E0AD60161 for ; Tue, 22 Oct 2019 13:58:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571752745; 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=3gag8RaptN81qH4+5MGFfGL3sDgh1jY8kVIok3pKMs4=; b=VphabyX5A1Knupo9MozUJBNspwdNEIVYOj2OAnN72IU690NEaELVmxs539sdxE+SBE8eU/ yAS9zezbqSncLbYnX8WYjwYrs+zrKD9anGbbVGno5pUClNg0Gw7wGu5FC1FnceD1aKtfJL arifUDlYcNiYmqcUtpe2H+DGuKqq4C8= From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 15:57:19 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 15/75] node_device: Drop virAsprintf() and virAsprintfQuiet() retval checking 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.11 X-MC-Unique: CFY46QWIN0KFb0z-Prh2mQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" These functions can't fail really. Drop checking of their retval then. Signed-off-by: Michal Privoznik --- src/node_device/node_device_driver.c | 3 +-- src/node_device/node_device_hal.c | 7 ++----- src/node_device/node_device_udev.c | 11 +++-------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index 7ef55f45e9..53373140be 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -113,8 +113,7 @@ nodeDeviceUpdateDriverName(virNodeDeviceDefPtr def) =20 VIR_FREE(def->driver); =20 - if (virAsprintf(&driver_link, "%s/driver", def->sysfs_path) < 0) - goto cleanup; + virAsprintf(&driver_link, "%s/driver", def->sysfs_path); =20 /* Some devices don't have an explicit driver, so just return without a name */ diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_devic= e_hal.c index 688a0e0f06..a6042e6bfc 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -614,16 +614,13 @@ nodeStateInitialize(bool privileged G_GNUC_UNUSED, nodeDeviceLock(); =20 if (privileged) { - if (virAsprintf(&driver->stateDir, - "%s/libvirt/nodedev", RUNSTATEDIR) < 0) - goto failure; + virAsprintf(&driver->stateDir, "%s/libvirt/nodedev", RUNSTATEDIR); } else { g_autofree char *rundir =3D NULL; =20 if (!(rundir =3D virGetUserRuntimeDirectory())) goto failure; - if (virAsprintf(&driver->stateDir, "%s/nodedev/run", rundir) < 0) - goto failure; + virAsprintf(&driver->stateDir, "%s/nodedev/run", rundir); } =20 if (virFileMakePathWithMode(driver->stateDir, S_IRWXU) < 0) { diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 525e71f80c..92d7048ece 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1028,9 +1028,7 @@ udevProcessMediatedDevice(struct udev_device *dev, * it by waiting for the attributes to become available. */ =20 - if (virAsprintf(&linkpath, "%s/mdev_type", - udev_device_get_syspath(dev)) < 0) - goto cleanup; + virAsprintf(&linkpath, "%s/mdev_type", udev_device_get_syspath(dev)); =20 if (virFileWaitForExists(linkpath, 1, 100) < 0) { virReportSystemError(errno, @@ -1812,16 +1810,13 @@ nodeStateInitialize(bool privileged, driver->privileged =3D privileged; =20 if (privileged) { - if (virAsprintf(&driver->stateDir, - "%s/libvirt/nodedev", RUNSTATEDIR) < 0) - goto cleanup; + virAsprintf(&driver->stateDir, "%s/libvirt/nodedev", RUNSTATEDIR); } else { g_autofree char *rundir =3D NULL; =20 if (!(rundir =3D virGetUserRuntimeDirectory())) goto cleanup; - if (virAsprintf(&driver->stateDir, "%s/nodedev/run", rundir) < 0) - goto cleanup; + virAsprintf(&driver->stateDir, "%s/nodedev/run", rundir); } =20 if (virFileMakePathWithMode(driver->stateDir, S_IRWXU) < 0) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list