public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Sami Mujawar <sami.mujawar@arm.com>
To: edk2-devel@lists.01.org
Cc: leif.lindholm@linaro.org, evan.lloyd@arm.com,
	Matteo.Carlini@arm.com, Stephanie.Hughes-Fitt@arm.com,
	nd@arm.com
Subject: [staging/dynamictables PATCH v1 4/5] DynamicTablesPkg: Fix macro to prevent side effect
Date: Wed, 27 Jun 2018 17:47:45 +0100	[thread overview]
Message-ID: <20180627164746.36188-5-sami.mujawar@arm.com> (raw)
In-Reply-To: <20180627164746.36188-1-sami.mujawar@arm.com>

The ALIGN32 macro had undesired side effects when used with binary
operators and was generating compilation errors.

Added brackets to fix this issue.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---

Notes:
    v1:
    - Fix macro side effect                                         [SAMI]

 DynamicTablesPkg/Include/Library/TableHelperLib.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DynamicTablesPkg/Include/Library/TableHelperLib.h b/DynamicTablesPkg/Include/Library/TableHelperLib.h
index b358223434af76820d34c29c67325919a2283aa7..3eac28a158e9621f6f33a5b538964a16e6b69112 100644
--- a/DynamicTablesPkg/Include/Library/TableHelperLib.h
+++ b/DynamicTablesPkg/Include/Library/TableHelperLib.h
@@ -17,7 +17,7 @@
 
 /** A helper macro to align a value to the 32-bit word boundary
 */
-#define ALIGN32(x) ((x) + (sizeof (UINT32) - 1)) & ~(sizeof (UINT32) - 1)
+#define ALIGN32(x) (((x) + (sizeof (UINT32) - 1)) & ~(sizeof (UINT32) - 1))
 
 /** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO
     object from the Configuration Manager.
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'




  parent reply	other threads:[~2018-06-27 16:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-27 16:47 [staging/dynamictables PATCH v1 0/5] Fix issues reported by ecc tool Sami Mujawar
2018-06-27 16:47 ` [staging/dynamictables PATCH v1 1/5] DynamicTablesPkg: Add module info to file header Sami Mujawar
2018-06-27 16:47 ` [staging/dynamictables PATCH v1 2/5] DynamicTablesPkg: Fix function documentation Sami Mujawar
2018-06-27 16:47 ` [staging/dynamictables PATCH v1 3/5] DynamicTablesPkg: Fix variable naming issue Sami Mujawar
2018-06-27 16:47 ` Sami Mujawar [this message]
2018-06-28 16:50   ` [staging/dynamictables PATCH v1 4/5] DynamicTablesPkg: Fix macro to prevent side effect Leif Lindholm
2018-06-28 17:10     ` Sami Mujawar
2018-06-29  9:41       ` Leif Lindholm
2018-06-27 16:47 ` [staging/dynamictables PATCH v1 5/5] DynamicTablesPkg: Fix variable declaration Sami Mujawar
2018-06-27 16:57 ` [staging/dynamictables PATCH v1 0/5] Fix issues reported by ecc tool Evan Lloyd
2018-07-02 14:00 ` Leif Lindholm

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=20180627164746.36188-5-sami.mujawar@arm.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