virtio-net: Fix VirtIONet typedef redefinition
commitb0b36c021b95eb69451a3e540c9b029a8fb5e21b
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 21 Jan 2019 18:10:30 +0000 (21 19:10 +0100)
committerThomas Huth <thuth@redhat.com>
Tue, 22 Jan 2019 05:26:05 +0000 (22 06:26 +0100)
tree0ef9098e13434239787ca556b4971915aa7155c8
parent0d8d6a24fc32c54359606d957d8acbe98b7be9c9
virtio-net: Fix VirtIONet typedef redefinition

Commit 2974e916df8 introduced the VirtioNetRscChain structure which
refer to a VirtIONet, declared later, thus required VirtIONet typedef
to use a forward declaration.
However, when compiling with Clang in -std=gnu99 mode, this triggers
the following warning/error:

    CC      hw/net/virtio-net.o
  In file included from qemu/hw/net/virtio-net.c:22:
  include/hw/virtio/virtio-net.h:189:3: error: redefinition of typedef 'VirtIONet' is a C11 feature [-Werror,-Wtypedef-redefinition]
  } VirtIONet;
    ^
  include/hw/virtio/virtio-net.h:110:26: note: previous definition is here
  typedef struct VirtIONet VirtIONet;
                           ^
  1 error generated.
  make: *** [rules.mak:69: hw/net/virtio-net.o] Error 1

Fix it by removing the duplicate typedef definition.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
include/hw/virtio/virtio-net.h