From: "Rebecca Cran" <rebecca@bsdio.com>
To: devel@edk2.groups.io, pedro.falcato@gmail.com
Cc: "Michael D Kinney" <michael.d.kinney@intel.com>,
"Liming Gao" <gaoliming@byosoft.com.cn>,
"Zhiguang Liu" <zhiguang.liu@intel.com>,
"Marvin Häuser" <mhaeuser@posteo.de>
Subject: Re: [edk2-devel] [PATCH 1/1] MdePkg/Base.h: Simply alignment expressions
Date: Mon, 15 May 2023 09:15:20 -0600 [thread overview]
Message-ID: <9bc20ea6-3bb6-8b13-ea9f-790bcbed71ea@bsdio.com> (raw)
In-Reply-To: <20230515144539.176967-1-pedro.falcato@gmail.com>
On 5/15/23 08:45, Pedro Falcato wrote:
> -#define ALIGN_VALUE_ADDEND(Value, Alignment) (((Alignment) - (Value)) & ((Alignment) - 1U))
> +#define ALIGN_VALUE_ADDEND(Value, Alignment) ((~(Value)) & ((Alignment) - 1U))
>
> /**
> Rounds a value up to the next boundary using a specified alignment.
> @@ -945,7 +945,7 @@ STATIC_ASSERT (ALIGNOF (__VERIFY_INT32_ENUM_SIZE) == sizeof (__VERIFY_INT32_ENUM
> @return A value up to the next boundary.
>
> **/
> -#define ALIGN_VALUE(Value, Alignment) ((Value) + ALIGN_VALUE_ADDEND (Value, Alignment))
> +#define ALIGN_VALUE(Value, Alignment) (((Value) + (Alignment - 1)) & ~(Alignment))
Since ALIGN_VALUE_ADDEND is only used in ALIGN_VALUE, it should probably
be deleted instead of updated.
--
Rebecca Cran
next prev parent reply other threads:[~2023-05-15 15:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-15 14:45 [PATCH 1/1] MdePkg/Base.h: Simply alignment expressions Pedro Falcato
2023-05-15 15:15 ` Rebecca Cran [this message]
2023-05-15 15:20 ` [edk2-devel] " Marvin Häuser
2023-05-15 15:29 ` Pedro Falcato
2023-05-15 15:33 ` Rebecca Cran
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=9bc20ea6-3bb6-8b13-ea9f-790bcbed71ea@bsdio.com \
--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