[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 01/33] xics: Minor fixes for XICSFabric interface
From: |
Greg Kurz |
Subject: |
Re: [PATCH v2 01/33] xics: Minor fixes for XICSFabric interface |
Date: |
Fri, 27 Sep 2019 09:17:48 +0200 |
On Fri, 27 Sep 2019 15:49:56 +1000
David Gibson <address@hidden> wrote:
> Interface instances should never be directly dereferenced. So, the common
> practice is to make them incomplete types to make sure no-one does that.
> XICSFrabric, however, had a dummy type which is less safe.
>
> We were also using OBJECT_CHECK() where we should have been using
> INTERFACE_CHECK().
>
> Signed-off-by: David Gibson <address@hidden>
> ---
Reviewed-by: Greg Kurz <address@hidden>
> include/hw/ppc/xics.h | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
> index 64a2c8862a..faa33ae943 100644
> --- a/include/hw/ppc/xics.h
> +++ b/include/hw/ppc/xics.h
> @@ -147,13 +147,9 @@ struct ICSIRQState {
> uint8_t flags;
> };
>
> -struct XICSFabric {
> - Object parent;
> -};
> -
> #define TYPE_XICS_FABRIC "xics-fabric"
> #define XICS_FABRIC(obj) \
> - OBJECT_CHECK(XICSFabric, (obj), TYPE_XICS_FABRIC)
> + INTERFACE_CHECK(XICSFabric, (obj), TYPE_XICS_FABRIC)
> #define XICS_FABRIC_CLASS(klass) \
> OBJECT_CLASS_CHECK(XICSFabricClass, (klass), TYPE_XICS_FABRIC)
> #define XICS_FABRIC_GET_CLASS(obj) \
- [PATCH v2 00/33] spapr: IRQ subsystem cleanup, David Gibson, 2019/09/27
- [PATCH v2 01/33] xics: Minor fixes for XICSFabric interface, David Gibson, 2019/09/27
- Re: [PATCH v2 01/33] xics: Minor fixes for XICSFabric interface,
Greg Kurz <=
- [PATCH v2 02/33] xics: Eliminate 'reject', 'resend' and 'eoi' class hooks, David Gibson, 2019/09/27
- [PATCH v2 03/33] xics: Rename misleading ics_simple_*() functions, David Gibson, 2019/09/27
- [PATCH v2 05/33] xics: Merge TYPE_ICS_BASE and TYPE_ICS_SIMPLE classes, David Gibson, 2019/09/27
- [PATCH v2 07/33] spapr: Fold spapr_phb_lsi_qirq() into its single caller, David Gibson, 2019/09/27
- [PATCH v2 06/33] xics: Create sPAPR specific ICS subtype, David Gibson, 2019/09/27
- [PATCH v2 10/33] spapr: Eliminate nr_irqs parameter to SpaprIrq::init, David Gibson, 2019/09/27
- [PATCH v2 18/33] spapr: Use less cryptic representation of which irq backends are supported, David Gibson, 2019/09/27
- [PATCH v2 14/33] spapr: Remove unhelpful tracepoints from spapr_irq_free_xics(), David Gibson, 2019/09/27