From: David Gibson <david@gibson.dropbear.id.au>
To: Daniel Henrique Barboza <danielhb413@gmail.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, clg@kaod.org
Subject: Re: [PATCH for-7.1 0/9] spapr: add drc->index, remove spapr_drc_index()
Date: Tue, 22 Mar 2022 12:03:34 +1100 [thread overview]
Message-ID: <YjkgZjefvhrnY7eh@yekko> (raw)
In-Reply-To: <9b90b3a2-c4a1-1b3c-d6d9-2c96921d7d14@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]
On Mon, Mar 21, 2022 at 04:58:47AM -0300, Daniel Henrique Barboza wrote:
>
>
> On 3/21/22 00:55, David Gibson wrote:
> > On Fri, Mar 18, 2022 at 02:33:11PM -0300, Daniel Henrique Barboza wrote:
> > > Hi,
> > >
> > > I decided to make this change after realizing that (1) spapr_drc_index()
> > > always return the same index value for the DRC regardless of machine or
> > > device state and (2) we call spapr_drc_index() a lot throughout the
> > > spapr code.
> >
> > Hmm.. so, spapr_drc_index() wasn't ever intended as an abstraction
> > point. Rather, it's just there as a matter of data redundancy. The
> > index can be derived from the drc->id and the type. Unless there's a
> > compelling reason otherwise, it's usually a good idea to store data in
> > just one form (if there's more it's an opportunity for bugs to let it
> > get out of sync).
>
>
> Hmm what if we store drc->index instead and derive drc->id from it? drc->index
> is read from several places, while drc->id is used just in spapr_drc_name() to
> write the DT (via spapr_dt_drc()).
That could work. It's still slightly redundant since the type part of
the index can be derived from the class, but I think it's not unreasonable.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2022-03-22 2:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 17:33 [PATCH for-7.1 0/9] spapr: add drc->index, remove spapr_drc_index() Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 1/9] hw/ppc/spapr_drc.c: add drc->index Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 2/9] hw/ppc/spapr_drc.c: redefine 'index' SpaprDRC property Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 3/9] hw/ppc/spapr_drc.c: use drc->index in trace functions Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 4/9] hw/ppc/spapr_drc.c: use drc->index Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 5/9] hw/ppc/spapr.c: " Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 6/9] hw/ppc/spapr_events.c: " Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 7/9] hw/ppc/spapr_nvdimm.c: " Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 8/9] hw/ppc/spapr_pci.c: " Daniel Henrique Barboza
2022-03-18 17:33 ` [PATCH for-7.1 9/9] hw/ppc/spapr_drc.c: remove spapr_drc_index() Daniel Henrique Barboza
2022-03-21 3:55 ` [PATCH for-7.1 0/9] spapr: add drc->index, " David Gibson
2022-03-21 7:58 ` Daniel Henrique Barboza
2022-03-22 1:03 ` David Gibson [this message]
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=YjkgZjefvhrnY7eh@yekko \
--to=david@gibson.dropbear.id.au \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.