From: Leif Lindholm <leif.lindholm@linaro.org>
To: chandni cherukuri <chandni.cherukuri@arm.com>
Cc: edk2-devel@lists.01.org
Subject: Re: [PATCH v2 edk2-platforms 1/5] Platform/ARM/Sgi: Adapt to changes in system-id DT node.
Date: Mon, 12 Nov 2018 16:26:22 +0000 [thread overview]
Message-ID: <20181112162622.kowqjvcktnqukg3h@bivouac.eciton.net> (raw)
In-Reply-To: <CADXzzgr8QXsFx9cW-J3Ocph3+SgOpyHbbvuJYHL8O4PRCifq4g@mail.gmail.com>
Hi Chandni,
On Mon, Nov 12, 2018 at 07:46:38PM +0530, chandni cherukuri wrote:
> > > > Since this is changing what the return value of the function means,
> > > > can the function description comment be updated as well?
> > > >
> > > The return value of the function is still the same as before. The function
> > > returns the 'PlatformId' variable in which the upper 4 bits consists of the
> > > Configuration ID and the lower 12 bits consists of the part number of
> > > the platform.
> >
> > Yes, but the fact that the return value is numerically the same is
> > irrelevant; it now means something different than what it used to be.
> >
> > Based on your explanation above, I would suggest a more appropriate
> > name for this function would now be GetSgiSystemId.
>
> Ok, will change the name of this function in the next version.
Thanks.
> > *however* ... it also makes me question why this change was made in
> > this way? If we're changing the underlying data structure, why are we
> > not also changing SGI_PLATFORM_DESCRIPTOR to reflect this?
>
> The intention was to not modify the existing code due to the changes
> in the 'system-id' device tree node. And this was done by
> concatenating the platform-id and config-id value into one. So this
> was the reason for not adding a 'config-id' member in the
> SGI_PLATFORM_DESCRIPTOR structure.
>
> > If we do that, we can then get rid of the opposite shifting/masking in
> > ArmSgiPkgEntryPoint() and nuke SGI_PART_NUM_MASK, SGI_CONFIG_SHIFT and
> > SGI_CONFIG_MASK completely.
>
> Ok. The preference was given to keep the format and the PlatformID
> parsing code as before, which, otherwise would need lot more changes
> to the code.
Understood. But I think this cleaner end result is well worth the
larger patch.
> > > > > + PlatformId = PlatformId | (ConfigId << SGI_CONFIG_SHIFT);
> > > > > +
> > > > > + return PlatformId;
> > > >
> > > > I would be happier with just the return statement - reusing the
> > > > PlatformId variable does not simplify anything.
> > > >
> > > I did not understand this point.
> >
> > Merely that
> >
> > return PlatformId | (ConfigId << SGI_CONFIG_SHIFT);
> >
> > is easier to read than (and hence preferable to)
> >
> > PlatformId = PlatformId | (ConfigId << SGI_CONFIG_SHIFT);
> >
> > return PlatformId;
> >
> > .
> Ok. will fix this in the next version.
This bit would no longer be needed if the change is made, and the
function returns the struct directly.
Best Regards,
Leif
next prev parent reply other threads:[~2018-11-12 16:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-05 9:26 [PATCH v2 edk2-platforms 0/5] Platform/ARM/Sgi: Add support for Clark.Ares and Chandni Cherukuri
2018-11-05 9:26 ` [PATCH v2 edk2-platforms 1/5] Platform/ARM/Sgi: Adapt to changes in system-id DT node Chandni Cherukuri
2018-11-09 16:29 ` Leif Lindholm
[not found] ` <CADXzzgrW-cpXxO99HOeFmgsa5xNEPaasa7tW1ZANWeEFA_S4ig@mail.gmail.com>
2018-11-12 11:25 ` Leif Lindholm
2018-11-12 14:16 ` chandni cherukuri
2018-11-12 16:26 ` Leif Lindholm [this message]
2018-11-05 9:26 ` [PATCH v2 edk2-platforms 2/5] Platform/ARM/Sgi: Add ACPI tables for SGI-Clark.Ares platform Chandni Cherukuri
2018-11-05 9:26 ` [PATCH v2 edk2-platforms 3/5] Platform/ARM/Sgi: Add support " Chandni Cherukuri
2018-11-05 9:26 ` [PATCH v2 edk2-platforms 4/5] Platform/ARM/Sgi: Add ACPI tables for SGI-Clark.Helios platform Chandni Cherukuri
2018-11-05 9:26 ` [PATCH v2 edk2-platforms 5/5] Platform/ARM/Sgi: Add platform support for SGI-Clark.Helios Chandni Cherukuri
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-list 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=20181112162622.kowqjvcktnqukg3h@bivouac.eciton.net \
--to=devel@edk2.groups.io \
/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