From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::243; helo=mail-wr0-x243.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0F1D4211F8893 for ; Fri, 29 Jun 2018 02:42:02 -0700 (PDT) Received: by mail-wr0-x243.google.com with SMTP id c13-v6so8203152wrq.2 for ; Fri, 29 Jun 2018 02:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6YmSAHDycxfuCE0RvQJgiu0W/H0Vd7dnhGN/fi2Zdz8=; b=PfGnN4nCIqUcEfrX2LrEwLvS97nfuJiy+v0YLUMWDCi3PJYhvEDK+tvbF0B1SYR2tW hoV2kXsIhe5wvDYn60yA/DXlny6F8IE5tFNMO3eGnBbUv5bgYSffUTopJyg9TRAud8zg 7HVKEgOlJF6ob5XoZwlrqRZQhrry8ZSnNeLCo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6YmSAHDycxfuCE0RvQJgiu0W/H0Vd7dnhGN/fi2Zdz8=; b=hReNECCTnE6k47djQfB4I/Qq7SjMn+MpZY+oR4lkVPbukAe5z4ymZs9UQcXsxKG6E/ J4Q0tA/gJo5hm8YmpS9d0srkX+U2kPG5TVOqAGjX9/h/wNBNSAPl9Z5+XLM6zxEpHDag q64e26lilLVmKb8RgEt5D+vYA+mAWmi76Vqz03c4bL8fuHdqoTwPe0hVIQ4hJlR81slt b4oPR03mjcbKb7VgqIWCurmNjgG8o4XZMStdLR5p6mhpR/bHNtiwo0VUSYVuDfCz+Frh Ix7JsS2ps25nbBBFCigC/2ftWeAFKkiIK7UQkTb6jEbEegJOBNiruNgizMy/k+zv/oVj Sd2w== X-Gm-Message-State: APt69E2UkdHuvmamoBRfzUyxNS9lrSPvq92U0rDlA/D8IqF3vEFRI3ur XRZvWpLWWJ8PbjR1UPRfY8IFZQ== X-Google-Smtp-Source: AAOMgpeZnOL4tndUzrwGaspmRFSq1lNstx+jkQmygM227UtuNbxbwTmOmWiMZf/JZhTy82rQ8aGBFA== X-Received: by 2002:a5d:4c4c:: with SMTP id n12-v6mr11277290wrt.71.1530265320987; Fri, 29 Jun 2018 02:42:00 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id s2-v6sm13140056wrn.75.2018.06.29.02.41.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 02:41:59 -0700 (PDT) Date: Fri, 29 Jun 2018 10:41:58 +0100 From: Leif Lindholm To: Sami Mujawar Cc: "edk2-devel@lists.01.org" , Evan Lloyd , Matteo Carlini , Stephanie Hughes-Fitt , nd Message-ID: <20180629094158.oktczxcj7vschjmy@bivouac.eciton.net> References: <20180627164746.36188-1-sami.mujawar@arm.com> <20180627164746.36188-5-sami.mujawar@arm.com> <20180628165054.6jnnna3zwlvlkejn@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) 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: Fri, 29 Jun 2018 09:42:03 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jun 28, 2018 at 05:10:48PM +0000, Sami Mujawar wrote: > 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? It won't actually garble the history to do it as a separate patch, so I'm happy with that. But I'm still waiting on a clarification from Evan. Best Regards, Leif > Regards, > > Sami Mujawar > -----Original Message----- > From: Leif Lindholm > Sent: 28 June 2018 05:51 PM > To: Sami Mujawar > Cc: edk2-devel@lists.01.org; Evan Lloyd ; Matteo Carlini ; Stephanie Hughes-Fitt ; nd > Subject: Re: [staging/dynamictables PATCH v1 4/5] DynamicTablesPkg: Fix macro 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 > > operators and was generating compilation errors. > > > > Added brackets to fix this issue. > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Sami Mujawar > > --- > > > > 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..3eac28a158e9621f6f33a5b53896 > > 4a16e6b69112 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)' > > > >