From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx.groups.io with SMTP id smtpd.web11.91444.1684164061119225568 for ; Mon, 15 May 2023 08:21:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=Vga9QyVZ; spf=pass (domain: posteo.de, ip: 185.67.36.65, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 360B524002F for ; Mon, 15 May 2023 17:20:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1684164059; bh=e1xNHNmfvZTMyaWNERkQ0nKO7WKBCXPuaCtLP6x76WA=; h=Mime-Version:Subject:From:Date:Cc:Content-Transfer-Encoding: Message-Id:To:From; b=Vga9QyVZBDFouCmB6Uw7CyGqMZL+4WLDZETzov5mV+tg4M9En5mbDMt64ISNI3pBv +Ogf66P5nCShY6i3gNCtWdaRiqxvfOZVz3iLhfKFNooEL70fjDVQhgyFRlkanOBhcd B0oDCJ8OXkE6IpwYmz8RWAylXzqXv4D/dAlcYBC6+c3QYf0ZZyjsU3MFdRULRC9oDZ JA9zqFh8RORUJaReSnNUAjybmzk9vucIFn2nTJw/2yRqVYo0RWuI6IsIyrWlMClN09 XkgMOpzOpLN3TN36HZKWZr199gjXYvMpFpDG9xrgz1roRo0x0fQvuD6EjQ/lEtDlya WAVVNX/3k5JLA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QKjkH58V1z6ty4; Mon, 15 May 2023 17:20:55 +0200 (CEST) Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: [edk2-devel] [PATCH 1/1] MdePkg/Base.h: Simply alignment expressions From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= In-Reply-To: <9bc20ea6-3bb6-8b13-ea9f-790bcbed71ea@bsdio.com> Date: Mon, 15 May 2023 15:20:45 +0000 Cc: edk2-devel-groups-io , Pedro Falcato , Michael D Kinney , Liming Gao , Zhiguang Liu , Gerd Hoffmann Message-Id: <43C66EEC-4489-4D1D-B345-04CC7AB83670@posteo.de> References: <20230515144539.176967-1-pedro.falcato@gmail.com> <9bc20ea6-3bb6-8b13-ea9f-790bcbed71ea@bsdio.com> To: Rebecca Cran Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Well, I explicitly added this macro as a prerequisite to code used in = our new PE library (remember this patch was initially sent in 2021). We = still require it downstream, but obviously upstream is not interested in = the related contributions that were to follow at the time. Gerd picked it up because he wanted to attempt to re-try contributing = the new PE library, but I haven't heard from him in weeks. Design-wise, I agree it could be removed again. However, there first was = a downstream burden when adding it (as we needed to rewrite our history = to drop our downstream patch in favour of the upstream solution). Now = introducing another downstream burden *again* to remove the macro that = was added only a few weeks back would be a sign of poor management and = planning. Best regards, Marvin > On 15. May 2023, at 17:15, Rebecca Cran wrote: >=20 > 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) = =3D=3D 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)) >=20 > Since ALIGN_VALUE_ADDEND is only used in ALIGN_VALUE, it should = probably be deleted instead of updated. >=20 >=20 > --=20 >=20 > Rebecca Cran >=20