From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by mx.groups.io with SMTP id smtpd.web10.91680.1684163725182327322 for ; Mon, 15 May 2023 08:15:25 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm2 header.b=Vy0c2nuc; spf=pass (domain: bsdio.com, ip: 64.147.123.20, mailfrom: rebecca@bsdio.com) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 0EC5932009B5; Mon, 15 May 2023 11:15:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 15 May 2023 11:15:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1684163723; x=1684250123; bh=aJO77d7uySxjPnJg36Bcc5B+4SrPZQQZEaY ZVzx2mrY=; b=Vy0c2nuc0+dTgQvmXICZgSR2nzFHW60V7Tf8QfXezrv6wU0U4ZM Xwa0ig2I6u0OFP3vklCt/reEDpXr/OFFd5qnpeVc466SGIhAXj3/Ghgio4Qy61G+ ErlRSSDvc4cO+W5DgVRC1bgwVnSOGiX5GjCrMtRKNHnYlvCMTXu5pCuGWJfOdj9p bWMurgdWR8oCEj7R/2Fn5LtQutXlZT4f6nLuZubYEyPOrR/Lu7FZUmPEd4CirkWb AUJMaFaqDabkS6LTLZdYeUKnx2mNd+lXb6/z0wMcjKScP4b8kf+5G93hCJe9hzpQ M48BmRa+PXHx+sUelGwOH+T2RloYhel25mw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1684163723; x=1684250123; bh=aJO77d7uySxjPnJg36Bcc5B+4SrPZQQZEaY ZVzx2mrY=; b=rjqA2QssTKHVUN4kbe1LZjECrLiPFhfiZSQobelhKMnmGxD8ogV o/GHaqrkppbNg7HBcut4OaaZ0WacrQepFFMCzRjZJRqZgJ+4vWgIhn/EvlEQ0Ign fhorROoHrAJEWjYKJBihdWY8ulMXTJdD2MlXSC0E1csSnjLyALZyFXXH0BTmyT3Y CpGckuoQ/tOFJuKlg52z36hmVsrcdbjtl9CKs3ZHJ7tmwNv6mEnSzu3ECdaFjgLe bFB4vR4aZSDAoRmkD8cxM3HVndjF++0MDQr9a12ujLc932haRmlfw2MS2dJiKFFE blFTevrAliv0IPo1KWMTGXdHCOMKJrB5b4g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeehjedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeftvggs vggttggrucevrhgrnhcuoehrvggsvggttggrsegsshguihhordgtohhmqeenucggtffrrg htthgvrhhnpeehleekgfdutedugeehgeffgffhteefhffhteetfeevhefgvdejhedthfff ieffleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrvggsvggttggrsegsshguihhordgtohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 May 2023 11:15:22 -0400 (EDT) Message-ID: <9bc20ea6-3bb6-8b13-ea9f-790bcbed71ea@bsdio.com> Date: Mon, 15 May 2023 09:15:20 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [edk2-devel] [PATCH 1/1] MdePkg/Base.h: Simply alignment expressions To: devel@edk2.groups.io, pedro.falcato@gmail.com Cc: Michael D Kinney , Liming Gao , Zhiguang Liu , =?UTF-8?Q?Marvin_H=c3=a4user?= References: <20230515144539.176967-1-pedro.falcato@gmail.com> From: "Rebecca Cran" In-Reply-To: <20230515144539.176967-1-pedro.falcato@gmail.com> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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