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

On Wed, Jun 27, 2018 at 05:47:45PM +0100, Sami Mujawar wrote:
> 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))

Not as such a comment on this patch, but this problem could also be
resolved by dropping this local macro in favour of the Base.h
ALIGN_VALUE(x, 4) ... or just redefining it to use that.

/
    Leif

>  
>  /** The GetCgfMgrInfo function gets the CM_STD_OBJ_CONFIGURATION_MANAGER_INFO
>      object from the Configuration Manager.
> -- 
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
> 
> 


  reply	other threads:[~2018-06-28 16:50 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 ` [staging/dynamictables PATCH v1 4/5] DynamicTablesPkg: Fix macro to prevent side effect Sami Mujawar
2018-06-28 16:50   ` Leif Lindholm [this message]
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=20180628165054.6jnnna3zwlvlkejn@bivouac.eciton.net \
    --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