From nobody Sun Feb 8 14:57:50 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=1571752724; cv=none; d=zoho.com; s=zohoarc; b=E20bEkY8XKXOHT1CYktjIgxMjGF8lDOkdrKm8vGmuU76zdQwyXzT981SidAuNfZRVfJFfh7NPZcBf1q9b0dEIHWA0fFwMm5p96X765TlU/vdlwtTyggw8YqIqcDF63ryUxOXXSxYPqwDdWhB/uceY3LnVpum26yR7seboedn+So= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571752724; 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=2+HXYGMHPox28UwNycDOUxu3WrKeauprJxdPgFOIBPM=; b=AsQa0s2wGHQOnkGHQRdD9r2G2eWHMK/VYMwgDo2HCoWTcc/b4ChJLsLf1EO3DDRSYytYF8B44b3NyXIeYWXgIBQTkjFYv7+B4mZRrsKgjtBHUrRCBJDN+v1kNz4zYiWvGVZu5p7I6UsWoPqfx/Eg6yrK/nk2dfeXzKJI9If88C0= 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-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1571752724183114.29286711888778; Tue, 22 Oct 2019 06:58:44 -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-143-j1P9zHWdPZ-nk_8h--XEkQ-1; Tue, 22 Oct 2019 09:58:41 -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 6529A1800E08; Tue, 22 Oct 2019 13:58:36 +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 40EBF5DAAD; Tue, 22 Oct 2019 13:58:36 +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 E21B24EE75; Tue, 22 Oct 2019 13:58:35 +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 x9MDwQqA001549 for ; Tue, 22 Oct 2019 09:58:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4DC956012E; Tue, 22 Oct 2019 13:58:26 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA8526012D for ; Tue, 22 Oct 2019 13:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571752723; 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=2+HXYGMHPox28UwNycDOUxu3WrKeauprJxdPgFOIBPM=; b=cubxxOyY0D32UcmgDoyr2Kk7nlBSGhG5hZ3cZ7/RTewQ/+f8WZvgLo4EDVEl4wbPOwTmsE WL6RYSVv+FYCRvWYm/8Gd+7WuMWFGdl2f2fo5D/cX98DQz2mfjf2oS0149r/uiY1TM6yt4 ssLxmAMz0OYOpa3X0AkiTkbFmzn1l1o= From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 15:57:10 +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 06/75] cpu: 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.14 X-MC-Unique: j1P9zHWdPZ-nk_8h--XEkQ-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/cpu/cpu_ppc64.c | 21 ++++++++++----------- src/cpu/cpu_x86.c | 19 ++++++++----------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 59a5e1fc1d..990bbbd45f 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -459,11 +459,10 @@ ppc64Compute(virCPUDefPtr host, if (!found) { VIR_DEBUG("CPU arch %s does not match host arch", virArchToString(cpu->arch)); - if (message && + if (message) virAsprintf(message, _("CPU arch %s does not match host arch"), - virArchToString(cpu->arch)) < 0) - goto cleanup; + virArchToString(cpu->arch)); =20 ret =3D VIR_CPU_COMPARE_INCOMPATIBLE; goto cleanup; @@ -477,12 +476,12 @@ ppc64Compute(virCPUDefPtr host, (!host->vendor || STRNEQ(cpu->vendor, host->vendor))) { VIR_DEBUG("host CPU vendor does not match required CPU vendor %s", cpu->vendor); - if (message && + if (message) { virAsprintf(message, _("host CPU vendor does not match required " - "CPU vendor %s"), - cpu->vendor) < 0) - goto cleanup; + "CPU vendor %s"), + cpu->vendor); + } =20 ret =3D VIR_CPU_COMPARE_INCOMPATIBLE; goto cleanup; @@ -532,12 +531,12 @@ ppc64Compute(virCPUDefPtr host, if (STRNEQ(guest_model->name, host_model->name)) { VIR_DEBUG("host CPU model does not match required CPU model %s", guest_model->name); - if (message && + if (message) { virAsprintf(message, _("host CPU model does not match required " - "CPU model %s"), - guest_model->name) < 0) - goto cleanup; + "CPU model %s"), + guest_model->name); + } =20 ret =3D VIR_CPU_COMPARE_INCOMPATIBLE; goto cleanup; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index d7fcb3b147..8418339d6f 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -1724,11 +1724,8 @@ virCPUx86DataParse(xmlXPathContextPtr ctxt) virReportOOMError(); \ goto error; \ } \ - if (message && \ - virAsprintf(message, "%s: %s", _(MSG), flagsStr) < 0) { \ - VIR_FREE(flagsStr); \ - goto error; \ - } \ + if (message) \ + virAsprintf(message, "%s: %s", _(MSG), flagsStr); \ VIR_DEBUG("%s: %s", MSG, flagsStr); \ VIR_FREE(flagsStr); \ ret =3D VIR_CPU_COMPARE_INCOMPATIBLE; \ @@ -1769,11 +1766,11 @@ x86Compute(virCPUDefPtr host, if (!found) { VIR_DEBUG("CPU arch %s does not match host arch", virArchToString(cpu->arch)); - if (message && + if (message) { virAsprintf(message, _("CPU arch %s does not match host arch"), - virArchToString(cpu->arch)) < 0) - goto error; + virArchToString(cpu->arch)); + } return VIR_CPU_COMPARE_INCOMPATIBLE; } arch =3D cpu->arch; @@ -1785,12 +1782,12 @@ x86Compute(virCPUDefPtr host, (!host->vendor || STRNEQ(cpu->vendor, host->vendor))) { VIR_DEBUG("host CPU vendor does not match required CPU vendor %s", cpu->vendor); - if (message && + if (message) { virAsprintf(message, _("host CPU vendor does not match required " "CPU vendor %s"), - cpu->vendor) < 0) - goto error; + cpu->vendor); + } =20 return VIR_CPU_COMPARE_INCOMPATIBLE; } --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list