public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: devel@edk2.groups.io, Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [edk2-devel] [PATCH 5/5] ArmPkg/ArmMmuLib: drop unused TT_ATTR_INDX_INVALID CPP symbol
Date: Thu, 2 Apr 2020 11:57:40 +0100	[thread overview]
Message-ID: <20200402105740.GO7468@vanye> (raw)
In-Reply-To: <24502c11-cab8-f00b-6c3f-e4705f315aea@arm.com>

On Thu, Apr 02, 2020 at 12:29:40 +0200, Ard Biesheuvel wrote:
> On 4/2/20 12:23 PM, Leif Lindholm via groups.io wrote:
> > On Sat, Mar 28, 2020 at 11:43:21 +0100, Ard Biesheuvel wrote:
> > > TT_ATTR_INDX_INVALID is #define'd but never used so drop it.
> > > 
> > > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > > ---
> > >   ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 3 ---
> > >   1 file changed, 3 deletions(-)
> > > 
> > > diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
> > > index a82596d290f1..222ff817956f 100644
> > > --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
> > > +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c
> > > @@ -19,9 +19,6 @@
> > >   #include <Library/BaseLib.h>
> > >   #include <Library/DebugLib.h>
> > > -// We use this index definition to define an invalid block entry
> > > -#define TT_ATTR_INDX_INVALID    ((UINT32)~0)
> > > -
> > 
> > Since this is separately defined also in
> > ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c (£"$%^£"$?!?!?)
> > could this patch be tweaked to instead "consolidate" the definitions
> > to a central location, like ArmPkg/Include/Chipset/AArch64Mmu.h where
> > all of the other TT_ATTR_INDX_ definitions live?
> > 
> 
> That would imply that this value is somehow architected, which it is not.
> 
> ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c is the only remaining user of this
> constant, and it only has meaning within the context of the routines
> therein.

Hmm, ok. So all of those definitions should really move *out* of
ArmPkg/Include/Chipset/AArch64Mmu.h?

No, they can't, because some of the others are used in
ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibCore.c

So I'm still feeling that #defines using the same namespace should
live together in order to reduce risk of future screwups.
So, unrelated to this patch
(Reviewed-by: Leif Lindholm <leif@nuviainc.com>)
should the remaining TT_ATTR_INDX_INVALID be renamed, or should it be
moved to ArmPkg/Include/Chipset/AArch64Mmu.h?

/
    Leif

  reply	other threads:[~2020-04-02 10:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 10:43 [PATCH 0/5] ArmPkg: cosmetic cleanups for ArmMmuLib Ard Biesheuvel
2020-03-28 10:43 ` [PATCH 1/5] ArmPkg/CpuDxe: use private copy of GetRootTranslationTableInfo() Ard Biesheuvel
2020-04-02 10:16   ` Leif Lindholm
2020-04-02 10:20     ` [edk2-devel] " Ard Biesheuvel
2020-04-02 10:28       ` Leif Lindholm
2020-04-02 10:29         ` Ard Biesheuvel
2020-04-02 11:03           ` Leif Lindholm
2020-04-02 12:44             ` Ard Biesheuvel
2020-03-28 10:43 ` [PATCH 2/5] ArmPkg/CpuDxe: move PageAttributeToGcdAttribute() out of ArmMmuLib Ard Biesheuvel
2020-03-28 10:43 ` [PATCH 3/5] ArmPkg/ArmMmuLib: drop pointless LookupAddresstoRootTable() routine Ard Biesheuvel
2020-03-28 10:43 ` [PATCH 4/5] ArmPkg/ArmMmuLib: get rid of GetRootTranslationTableInfo() Ard Biesheuvel
2020-03-28 10:43 ` [PATCH 5/5] ArmPkg/ArmMmuLib: drop unused TT_ATTR_INDX_INVALID CPP symbol Ard Biesheuvel
2020-04-02 10:23   ` Leif Lindholm
2020-04-02 10:29     ` [edk2-devel] " Ard Biesheuvel
2020-04-02 10:57       ` Leif Lindholm [this message]
2020-04-02 11:05         ` Ard Biesheuvel

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=20200402105740.GO7468@vanye \
    --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