* [PATCH] ppc/pnv: Make PnvXScomInterface an incomplete type
@ 2019-12-11 14:32 Greg Kurz
2019-12-11 15:35 ` Cédric Le Goater
0 siblings, 1 reply; 3+ messages in thread
From: Greg Kurz @ 2019-12-11 14:32 UTC (permalink / raw)
To: David Gibson; +Cc: qemu-ppc, Cédric Le Goater, qemu-devel
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.
Signed-off-by: Greg Kurz <groug@kaod.org>
---
include/hw/ppc/pnv_xscom.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h
index 1c1d76bf9be5..b738011ab205 100644
--- a/include/hw/ppc/pnv_xscom.h
+++ b/include/hw/ppc/pnv_xscom.h
@@ -22,9 +22,7 @@
#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) \
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ppc/pnv: Make PnvXScomInterface an incomplete type
2019-12-11 14:32 [PATCH] ppc/pnv: Make PnvXScomInterface an incomplete type Greg Kurz
@ 2019-12-11 15:35 ` Cédric Le Goater
2019-12-11 15:58 ` Greg Kurz
0 siblings, 1 reply; 3+ messages in thread
From: Cédric Le Goater @ 2019-12-11 15:35 UTC (permalink / raw)
To: Greg Kurz, David Gibson; +Cc: qemu-ppc, qemu-devel
On 11/12/2019 15:32, Greg Kurz wrote:
> 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.
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
> ---
> include/hw/ppc/pnv_xscom.h | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h
> index 1c1d76bf9be5..b738011ab205 100644
> --- a/include/hw/ppc/pnv_xscom.h
> +++ b/include/hw/ppc/pnv_xscom.h
> @@ -22,9 +22,7 @@
>
> #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) \
We should use INTERFACE_CHECK() here.
C.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ppc/pnv: Make PnvXScomInterface an incomplete type
2019-12-11 15:35 ` Cédric Le Goater
@ 2019-12-11 15:58 ` Greg Kurz
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kurz @ 2019-12-11 15:58 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: qemu-ppc, qemu-devel, David Gibson
On Wed, 11 Dec 2019 16:35:41 +0100
Cédric Le Goater <clg@kaod.org> wrote:
> On 11/12/2019 15:32, Greg Kurz wrote:
> > 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.
> >
> > Signed-off-by: Greg Kurz <groug@kaod.org>
> > ---
> > include/hw/ppc/pnv_xscom.h | 4 +---
> > 1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/include/hw/ppc/pnv_xscom.h b/include/hw/ppc/pnv_xscom.h
> > index 1c1d76bf9be5..b738011ab205 100644
> > --- a/include/hw/ppc/pnv_xscom.h
> > +++ b/include/hw/ppc/pnv_xscom.h
> > @@ -22,9 +22,7 @@
> >
> > #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) \
>
> We should use INTERFACE_CHECK() here.
>
Heh you're right, I missed that :) I'll send a v2 right away.
> C.
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-12-11 15:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 14:32 [PATCH] ppc/pnv: Make PnvXScomInterface an incomplete type Greg Kurz
2019-12-11 15:35 ` Cédric Le Goater
2019-12-11 15:58 ` Greg Kurz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).