]> xenbits.xensource.com Git - libvirt.git/commit
cpu: Remove pointless check
authorMartin Kletzander <mkletzan@redhat.com>
Wed, 27 Apr 2022 07:42:59 +0000 (09:42 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Wed, 27 Apr 2022 07:42:59 +0000 (09:42 +0200)
commit381498796cb45dfa80cbfe3f9834072808c691f6
tree49d751aa61fa4d1750b657e23efa98f4148d0a0d
parent6975ed0a940401bd6ac5d75bbec758f340e7351c
cpu: Remove pointless check

These two pointers can never be NULL since they are initialised to a reference
of a struct.  This became apparent when commit 210a19539447 added a VIR_DEBUG
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 that
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 ‘virCPUx86DataIsIdentical’:
  ../src/util/virlog.h:79:5: error: ‘bdata’ may be used uninitialized in this
  function [-Werror=maybe-uninitialized]

Fix this by just assigning the helper pointers and remove the condition
altogether.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/cpu/cpu_x86.c