qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH 3/3] spapr: Correct type for SPAPR_DRC_PCI
Date: Wed, 26 Aug 2020 12:21:37 -0400	[thread overview]
Message-ID: <20200826162137.GE642093@habkost.net> (raw)
In-Reply-To: <20200825111627.2007820-4-david@gibson.dropbear.id.au>

On Tue, Aug 25, 2020 at 09:16:27PM +1000, David Gibson wrote:
> TYPE_SPAPR_DRC_PCI inherits from TYPE_SPAPR_DRC_PHYSICAL, so its checker
> macro should use the corresponding instance type.  We got away with it
> because we never actually used that checker macro.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
>  include/hw/ppc/spapr_drc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
> index 21af8deac1..baaaba3c1f 100644
> --- a/include/hw/ppc/spapr_drc.h
> +++ b/include/hw/ppc/spapr_drc.h
> @@ -59,7 +59,7 @@
>          OBJECT_GET_CLASS(SpaprDrcClass, obj, TYPE_SPAPR_DRC_PCI)
>  #define SPAPR_DRC_PCI_CLASS(klass) \
>          OBJECT_CLASS_CHECK(SpaprDrcClass, klass, TYPE_SPAPR_DRC_PCI)
> -#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(SpaprDrc, (obj), \
> +#define SPAPR_DRC_PCI(obj) OBJECT_CHECK(SpaprDrcPhysical, (obj), \
>                                          TYPE_SPAPR_DRC_PCI)

I'm not sure this is really what we want to do.  This is what
triggered the warning in my script, but it doesn't mean we want
to use SpaprDrcPhysical here.

Code that needs a SpaprDrc* can use SPAPR_DR_CONNECTOR();
code that needs a SpaprDrcPhysical* can use SPAPR_DRC_PHYSICAL().
All the other OBJECT_CHECK(SpaprDrc, ...) and
OBJECT_CHECK(SpaprDrcPhysical, ...) macros seem unnecessary.

-- 
Eduardo



  reply	other threads:[~2020-08-26 16:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 11:16 [PATCH 0/3] ppc: Fixes for class and instance size problems David Gibson
2020-08-25 11:16 ` [PATCH 1/3] adb: Correct class size on TYPE_ADB_DEVICE David Gibson
2020-09-01  9:56   ` Philippe Mathieu-Daudé
2020-08-25 11:16 ` [PATCH 2/3] ppc/pnv: Fix TypeInfo of PnvLpcController abstract class David Gibson
2020-09-01  9:56   ` Philippe Mathieu-Daudé
2020-08-25 11:16 ` [PATCH 3/3] spapr: Correct type for SPAPR_DRC_PCI David Gibson
2020-08-26 16:21   ` Eduardo Habkost [this message]
2020-08-31 23:52     ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200826162137.GE642093@habkost.net \
    --to=ehabkost@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).