From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1klu24-0004Dt-Ls for mharc-grub-devel@gnu.org; Sun, 06 Dec 2020 08:24:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49648) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klu1y-0004CF-Mb for grub-devel@gnu.org; Sun, 06 Dec 2020 08:24:51 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:52047) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klu1w-0001gL-QW for grub-devel@gnu.org; Sun, 06 Dec 2020 08:24:50 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 5CA5495B; Sun, 6 Dec 2020 08:24:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sun, 06 Dec 2020 08:24:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=HTFc4JDeEPpx69Nw8WYBfTAL21p 3Iyz1JlsUjK12skU=; b=mGBrFhJP9W69qJwJb5Y7bwjTKSkd9XviT5YBE0zf5eV Va5lXD9jGXL45B+pwFnofaJdJo+RmtMrRn/8A4h8ZQqRppSaS0ezZwB+i+wiifwh +jYKYEw/huXBigsnTdbpiQLsiLP260EemWWs9wTyxSLN9qWxmLruLaN9/GaXfy+5 Enj583PbFOYLTMJpEu+lYJyREApOG60cuk8GMBBjlSkWFATPDT1zMSCOVJwgvUVi Uxeig61A4Sw/Gis4eZQzYML6gUuAl96RgSzlOiaacB8OoqIVNM05r8zzlwKnw/PW zTZbyr7YL+gehn0omC5a3XLu6LP6cwt2N86jBzNfxFA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=HTFc4J DeEPpx69Nw8WYBfTAL21p3Iyz1JlsUjK12skU=; b=hbbE5h9/eK/WdSpW8kLGqO MUqjq+xz1hI/mRutXRKjcv+V+XmnjtfIcaMA4jldPRvLTQAJnb1IsCuKaxJUU/ni uuqjAC0s6KNjZBNUHGPZmeYvNOp1q5+I24kvl6Bo/OEJK68s6+OpKQ/48HJ9tgPp toyXpcBvapSXVEu8gTEuTV1mtyxBr3gEXI1yvi6o9+G5VKWbJ1Y3JcwLeEs2sFPH PkfcC5yZzbrM++wKrU9toA1XKoJGmu8V/UbCIxQ9wEPR3Kbbnrm5nxG0PQilacej ogPq0gv8gaFpmeBlNrxpXHVawk3MAYLA86QjWFYjEvkjCjDMpeIPiAG7Fu5YO7eg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudejvddghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepjeejrddukeefrddujedruddutdenucevlhhushhtvghrufhiiigvpedunecurf grrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Received: from vm-mail (x4db7116e.dyn.telefonica.de [77.183.17.110]) by mail.messagingengine.com (Postfix) with ESMTPA id 602AA240059; Sun, 6 Dec 2020 08:24:46 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail (OpenSMTPD) with ESMTPSA id 42aaa475 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 6 Dec 2020 13:24:44 +0000 (UTC) Date: Sun, 6 Dec 2020 14:24:43 +0100 From: Patrick Steinhardt To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH v7 02/17] misc: Add parentheses around ALIGN_UP and ALIGN_DOWN arguments Message-ID: References: <77f9671d5ddaffd454e2d7272f21b434fd2212fb.1607098915.git.development@efficientek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0VCMJOJJXh3Rcpxx" Content-Disposition: inline In-Reply-To: <77f9671d5ddaffd454e2d7272f21b434fd2212fb.1607098915.git.development@efficientek.com> Received-SPF: pass client-ip=64.147.123.24; envelope-from=ps@pks.im; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2020 13:24:52 -0000 --0VCMJOJJXh3Rcpxx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 04, 2020 at 10:43:31AM -0600, Glenn Washburn wrote: > This ensures that expected order of operations is preserved when arguments > are expressions. >=20 > Signed-off-by: Glenn Washburn Reviewed-by: Patrick Steinhardt > --- > include/grub/misc.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/include/grub/misc.h b/include/grub/misc.h > index b7ca6dd58..780a34e90 100644 > --- a/include/grub/misc.h > +++ b/include/grub/misc.h > @@ -28,10 +28,10 @@ > #include > =20 > #define ALIGN_UP(addr, align) \ > - ((addr + (typeof (addr)) align - 1) & ~((typeof (addr)) align - 1)) > + (((addr) + (typeof (addr)) (align) - 1) & ~((typeof (addr)) (align) - 1= )) > #define ALIGN_UP_OVERHEAD(addr, align) ((-(addr)) & ((typeof (addr)) (al= ign) - 1)) > #define ALIGN_DOWN(addr, align) \ > - ((addr) & ~((typeof (addr)) align - 1)) > + ((addr) & ~((typeof (addr)) (align) - 1)) > #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) > #define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; } > =20 > --=20 > 2.27.0 >=20 --0VCMJOJJXh3Rcpxx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl/M25oACgkQVbJhu7ck PpQz/w/8CQ3xFYJMk+41TJHrJuJE3LOAacxFYdatZPk97ZGiwgHQHPRLQghnz93n 6iQlL1o5GPSL0ioiRiExY9Bvq285gKCxGg0nqgIooqjKIl43NkXuX22r4vqfzWH9 yb2aCtTL4CvPK3UkNzt4QO9MYKmn63GNu3A6eOWbziRoBzGzirWOd3Z1N549jpe8 LzkDR5DXW78IhUAl7xtjSZ8rUkcESgZLOXQfAPsfAAoNJBwqZoTt86rVwQ6u2szx FyUO9rDPRpQ4dFMgFaHnp1cuKM6IXKTBcvSqEj7mAUx8HtDrJmm9ijJmZITBGPoK zP6Of7tt77Tleol0Fu1Tfm0LrZpGzL/QleltYoyPZvwRlOKp4q3o8PQ1sA8dE1Mx IiQkhjfOzCGoeYMQjDJJzrcNRAghTq22gvs3za7EN6J//PxVxY/zU4wp7z2CYkrs tHUS8olzs8fQg2iJ8njdA/Qr2diDrd4Y+mtv3Wt43d1f3woa0tEBu42OUKaNcGVJ OaoYWVlN85touMAcdxdpe0J9nx/537VW2iEaQvmBdP17/JDsT6U7SwJ/kcZo9yyK PoE65/AydG9X5Paf+GzLcbD2vfkTz02dzGnvDhidY9xbIJ3Hbyesy1IzIQcLCK2l 6q5wrkTvvE/jlzgXb3xfIKdCXJ0rwKufyR4CdnrmtsOngYaAT5M= =+5Mx -----END PGP SIGNATURE----- --0VCMJOJJXh3Rcpxx--