From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=40.107.5.59; helo=eur03-ve1-obe.outbound.protection.outlook.com; envelope-from=sami.mujawar@arm.com; receiver=edk2-devel@lists.01.org Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50059.outbound.protection.outlook.com [40.107.5.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7FE56211F8895 for ; Thu, 28 Jun 2018 10:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UEOYU5QG7Pv/LFS7+Hu5CY5lTYOLa01ggnUxh7eA1xU=; b=FH/hXAJg3NdxvmdPoOTHEScYsshVqvGNHKnFORXpA57lRzqWx5c6BA/CCKM1CMavJmzLKVvMDKGG95mVf7tjNWkh67SgaxTScM0gnfUHxoJWMurHNV5/YCR62kBdgsM06j2ZOsFRDt7/XvZO0JPGp7AWuQh2mths4N4uFZD/hBw= Received: from DB6PR0802MB2375.eurprd08.prod.outlook.com (10.172.228.142) by DB6PR0802MB2502.eurprd08.prod.outlook.com (10.172.251.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.23; Thu, 28 Jun 2018 17:10:49 +0000 Received: from DB6PR0802MB2375.eurprd08.prod.outlook.com ([fe80::55c6:5a33:4bc4:1a50]) by DB6PR0802MB2375.eurprd08.prod.outlook.com ([fe80::55c6:5a33:4bc4:1a50%3]) with mapi id 15.20.0906.023; Thu, 28 Jun 2018 17:10:49 +0000 From: Sami Mujawar To: Leif Lindholm CC: "edk2-devel@lists.01.org" , Evan Lloyd , Matteo Carlini , Stephanie Hughes-Fitt , nd Thread-Topic: [staging/dynamictables PATCH v1 4/5] DynamicTablesPkg: Fix macro to prevent side effect Thread-Index: AQHUDwAwLPZMxXffd0m/zyTQ2cyCqaR15RlQ Date: Thu, 28 Jun 2018 17:10:48 +0000 Message-ID: References: <20180627164746.36188-1-sami.mujawar@arm.com> <20180627164746.36188-5-sami.mujawar@arm.com> <20180628165054.6jnnna3zwlvlkejn@bivouac.eciton.net> In-Reply-To: <20180628165054.6jnnna3zwlvlkejn@bivouac.eciton.net> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Sami.Mujawar@arm.com; x-originating-ip: [82.24.247.60] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2502; 7:l9sXcBLfqk9hnIX/wkdztdSLlmlMHzvfT/BWUPR4gC0A0ojqHdgHdDgVClOyhAjqXLNjLwUeLcSvHI2TW0a1UAYbLdSILNc/TMZ3iMD4cswlcoPQ+2I7ISghWqE1PUIUqk9sHtZrHByBPptzjurp1ndT0bVnMnw9oAhEBHAJnYt2fJn9yFxKdrGjJmmXxJ84DbMdlBTpgjkI281X5cfix+0vkIF9EbBQkIFflc5ua3Kw2DdZw33OoZTQyUdWlOgB x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-ms-office365-filtering-correlation-id: 981e5e36-dd85-4e48-c337-08d5dd1a1862 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2502; x-ms-traffictypediagnostic: DB6PR0802MB2502: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(162533806227266); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DB6PR0802MB2502; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2502; x-forefront-prvs: 0717E25089 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(396003)(39860400002)(136003)(189003)(13464003)(199004)(86362001)(3846002)(9686003)(2900100001)(6916009)(33656002)(74316002)(81166006)(8936002)(229853002)(72206003)(81156014)(8676002)(25786009)(6436002)(14444005)(316002)(54906003)(4326008)(186003)(99286004)(97736004)(2906002)(5250100002)(26005)(102836004)(76176011)(106356001)(105586002)(53546011)(486006)(7696005)(6116002)(446003)(5660300001)(11346002)(14454004)(55016002)(305945005)(68736007)(478600001)(6246003)(53936002)(476003)(7736002)(256004)(6506007)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2502; H:DB6PR0802MB2375.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: nkIqqPKd3WkK8HVWhuh5+xUUPkdLeN2cPjoVZBDzD9sPJp1s2T0f3zSd8cwqcGVBhhaVU2edEsEAsg54Kl7reS0p2sDJXQ9WB3emsoG9qZqJqlVsnw71nYdCnEu203Pikga1ay1tMj51UcB+QxEX8czxa3muhwKXuzbC3KIIl0ZBZsFdfe+qKyMHI/HiZDJuCxnoAse7aAZWErjnU5bhVBOyqYIifVpiRzqbTHDSseJ/Jpafnq7UQBhDIL9sH9GeG120dODlSzvrS0QlbvIyNO5oUv8I/dQf//EhThLwY9pVVTQDZcrW3QCUu3W2h/yXLMQCShJnA/XrQ1XkC+9vBbYqKEU1pfGR0rPafHT4NxA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 981e5e36-dd85-4e48-c337-08d5dd1a1862 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2018 17:10:48.9125 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2502 Subject: Re: [staging/dynamictables PATCH v1 4/5] DynamicTablesPkg: Fix macro to prevent side effect X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2018 17:10:53 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Leif, I agree it will be good to update the code to use ALIGN_VALUE(x,4). I can see 2 options to fix this: - Resubmit a v2 patchset with this change. OR - I can submit a separate patch (on top of the current patchset) for this= change. Can you let me know which one is preferred, please? Regards, Sami Mujawar -----Original Message----- From: Leif Lindholm =20 Sent: 28 June 2018 05:51 PM To: Sami Mujawar Cc: edk2-devel@lists.01.org; Evan Lloyd ; Matteo Carlin= i ; Stephanie Hughes-Fitt ; nd Subject: Re: [staging/dynamictables PATCH v1 4/5] DynamicTablesPkg: Fix mac= ro to prevent side effect On Wed, Jun 27, 2018 at 05:47:45PM +0100, Sami Mujawar wrote: > The ALIGN32 macro had undesired side effects when used with binary=20 > operators and was generating compilation errors. >=20 > Added brackets to fix this issue. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Sami Mujawar > --- >=20 > Notes: > v1: > - Fix macro side effect [SAMI= ] >=20 > DynamicTablesPkg/Include/Library/TableHelperLib.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/DynamicTablesPkg/Include/Library/TableHelperLib.h=20 > b/DynamicTablesPkg/Include/Library/TableHelperLib.h > index=20 > b358223434af76820d34c29c67325919a2283aa7..3eac28a158e9621f6f33a5b53896 > 4a16e6b69112 100644 > --- a/DynamicTablesPkg/Include/Library/TableHelperLib.h > +++ b/DynamicTablesPkg/Include/Library/TableHelperLib.h > @@ -17,7 +17,7 @@ > =20 > /** A helper macro to align a value to the 32-bit word boundary */=20 > -#define ALIGN32(x) ((x) + (sizeof (UINT32) - 1)) & ~(sizeof (UINT32)=20 > - 1) > +#define ALIGN32(x) (((x) + (sizeof (UINT32) - 1)) & ~(sizeof (UINT32)=20 > +- 1)) Not as such a comment on this patch, but this problem could also be resolve= d by dropping this local macro in favour of the Base.h ALIGN_VALUE(x, 4) ..= . or just redefining it to use that. / Leif > =20 > /** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER= _INFO > object from the Configuration Manager. > -- > 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' >=20 >=20