From nobody Fri May 17 01:43:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1651045942; cv=none; d=zohomail.com; s=zohoarc; b=HfG5ljtXVuXuTTNuXaST7rdWpMCrhOc4xdS/BTkYq6/v/WCc1AqRG+MsHQtQuCAzqqMdPf/71XIciIsSXR3d+xO7H/k1Z7HmMhMbhXqvJNIBp8T8rKP8uy2wgYq/i5jirUAK/ywvS0TigigAUKRZ6qPjdqlWmkOcAdDJAiNKQ0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1651045942; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=JssbOdr5a3qMhwEH4YgO93adZCTUnrcu4SHybcHSPi4=; b=OVtXzD64mRkQt1ZLaCUWX8r0/8xFtDsE5kQkZ8RlBtYwmUaFOLPxDq4gleDDPNapcStSjWd/oWffI0UOfFR1RvsFHxhSlrR4ctWflzZK4mVvwnI/pQLjRplkDlYarRkJFCQe6NfhkUkV6kGUWBe9IIS3raYryVFRyRQhss+K094= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1651045942541942.9705520463453; Wed, 27 Apr 2022 00:52:22 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-620-UpjkuZnaN5StT-2p1GtkBw-1; Wed, 27 Apr 2022 03:52:17 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 336CF3810D2C; Wed, 27 Apr 2022 07:52:15 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A23AA463E17; Wed, 27 Apr 2022 07:52:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6476E1947041; Wed, 27 Apr 2022 07:52:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F0BDB1947040 for ; Wed, 27 Apr 2022 07:52:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CC5DD40CFD06; Wed, 27 Apr 2022 07:52:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C75B140CFD05 for ; Wed, 27 Apr 2022 07:52:12 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE90285A5A8 for ; Wed, 27 Apr 2022 07:52:12 +0000 (UTC) Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-482-zBH5xNZgPmqe1-CH4KaaVQ-1; Wed, 27 Apr 2022 03:52:11 -0400 Received: by mail-ej1-f70.google.com with SMTP id sd16-20020a1709076e1000b006f3c9ec53f6so589486ejc.0 for ; Wed, 27 Apr 2022 00:52:11 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id s15-20020a1709066c8f00b006f38d5651e5sm4277530ejr.174.2022.04.27.00.52.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 00:52:09 -0700 (PDT) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id E93E16859F50 for ; Wed, 27 Apr 2022 09:52:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651045941; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JssbOdr5a3qMhwEH4YgO93adZCTUnrcu4SHybcHSPi4=; b=Swd5NzoO6VinDJDYw6bLKK7rwWlLY7DAJ9w/kYNgWYFXgiLLE/zJSdDgn29AJ9T5z4cDae Ir9+MTVqLSrabc7f+Cbgf1TUyuSQwK4dS97SKmwBsjKb1h80V2PT/af256NnCHfvQNCIVC 5oWe3AhtoHqktzZ3GhKhDKJXXtT7gBs= X-MC-Unique: UpjkuZnaN5StT-2p1GtkBw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: zBH5xNZgPmqe1-CH4KaaVQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=JssbOdr5a3qMhwEH4YgO93adZCTUnrcu4SHybcHSPi4=; b=49Iw0q5KoaD1svOQL+oEMrY/EOFJVCYzlPgslAVIsvZhq2ptSZ9pgDdvUftZJ/+eOu +3mUoL6DSiuopJOMfxUix/Vj3gQZNcHUWkA5Z8Z5XwcHegN6AGZZ0vbCATcSZmsGzmf4 l3scKFvkb2nMtQfghUt3SZmwTss2iJn6xZ98NbIV17VktAiv8jKnVymcLIxwnFF0mAa1 WohOhgbIBUSPNjVcZxFMCLaxov9LLjQRB7W8q5X/TMRepU7cCE4MVSe3J6P4qMA7EXsq gYGwHt96RW7wfhjOupHPkLHGi2XhDbsTO9ao3NeLtWQB7r71PlAkvmpnlbFHLPR6UdV3 l1aw== X-Gm-Message-State: AOAM532uy1d+MrqXbYpVzBPQIqaxSTvFFo9yYcKOynYe/UskReQ5fN0U fZF4qRi0eLUTwHCbB0e8eI+8mT3VMaJFIFtLwtwI1DXI6hYWAzwDPWkF3EVLqZV3ItnxIbbCDRk 0nUJSoKdeomQ1/MZ8V85XECQAXTKzudJd0rt5VE0d7ye+0FZRfzifgrpzdDYzGXI0/khjmxk= X-Received: by 2002:a17:907:9958:b0:6e7:f67a:a1e7 with SMTP id kl24-20020a170907995800b006e7f67aa1e7mr24266406ejc.400.1651045930272; Wed, 27 Apr 2022 00:52:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzH3CZ44U6PWcSCIrqtdRZ28lleGH21jvEH9wcGDFuszSF/TcRXLX7ETAGQYcPY3LkuiEc36Q== X-Received: by 2002:a17:907:9958:b0:6e7:f67a:a1e7 with SMTP id kl24-20020a170907995800b006e7f67aa1e7mr24266385ejc.400.1651045929951; Wed, 27 Apr 2022 00:52:09 -0700 (PDT) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH] cpu: Remove pointless check Date: Wed, 27 Apr 2022 09:51:34 +0200 Message-Id: <381498796cb45dfa80cbfe3f9834072808c691f6.1651045868.git.mkletzan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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) X-ZM-MESSAGEID: 1651045944276100001 These two pointers can never be NULL since they are initialised to a refere= nce of a struct. This became apparent when commit 210a19539447 added a VIR_DEB= UG which used both pointers because due to the concise condition the compiler = saw that if the "and" part of the condition did short-circuit (and it assumed t= hat can happen) the second variable would not be initialised, but it is used in= the debugging message, so the build failed with: In file included from ../src/cpu/cpu_x86.c:27: ../src/cpu/cpu_x86.c: In function =E2=80=98virCPUx86DataIsIdentical=E2=80= =99: ../src/util/virlog.h:79:5: error: =E2=80=98bdata=E2=80=99 may be used uni= nitialized in this function [-Werror=3Dmaybe-uninitialized] Fix this by just assigning the helper pointers and remove the condition altogether. Signed-off-by: Martin Kletzander --- Pushed under the build-breaker rule, but feel free to review/object. src/cpu/cpu_x86.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 7e9d1cea47d1..a5eac7601cad 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -3314,10 +3314,8 @@ virCPUx86DataIsIdentical(const virCPUData *a, return VIR_CPU_COMPARE_INCOMPATIBLE; } =20 - if (!((adata =3D &a->data.x86) && (bdata =3D &b->data.x86))) { - VIR_DEBUG("missing x86 data: a:%p b:%p", adata, bdata); - return VIR_CPU_COMPARE_ERROR; - } + adata =3D &a->data.x86; + bdata =3D &b->data.x86; =20 if (adata->len !=3D bdata->len) { VIR_DEBUG("unequal length a:%zu b:%zu", adata->len, bdata->len); --=20 2.35.1