Skip to content

Commit

Permalink
ppc/pnv: Make PnvXScomInterface an incomplete type
Browse files Browse the repository at this point in the history
PnvXScomInterface is an interface instance. It should never be
dereferenced. Drop the dummy type definition for extra safety,
which is the common practice with QOM interfaces.

While here also convert the bogus OBJECT_CHECK() to INTERFACE_CHECK().

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <157608025541.186670.1577861507610404326.stgit@bahia.lan>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
gkurz authored and dgibson committed Dec 16, 2019
1 parent 9e028ff commit 90cce00
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/hw/ppc/pnv_xscom.h
Expand Up @@ -22,13 +22,11 @@

#include "qom/object.h"

typedef struct PnvXScomInterface {
Object parent;
} PnvXScomInterface;
typedef struct PnvXScomInterface PnvXScomInterface;

#define TYPE_PNV_XSCOM_INTERFACE "pnv-xscom-interface"
#define PNV_XSCOM_INTERFACE(obj) \
OBJECT_CHECK(PnvXScomInterface, (obj), TYPE_PNV_XSCOM_INTERFACE)
INTERFACE_CHECK(PnvXScomInterface, (obj), TYPE_PNV_XSCOM_INTERFACE)
#define PNV_XSCOM_INTERFACE_CLASS(klass) \
OBJECT_CLASS_CHECK(PnvXScomInterfaceClass, (klass), \
TYPE_PNV_XSCOM_INTERFACE)
Expand Down

0 comments on commit 90cce00

Please sign in to comment.